Hi, We have configured a linux shell command 2 state monitor on SCOM SP1, to run a quick command on a mongodb server. The monitor is disabled in general but enabled for a single mongodb test server.
The shell command is:
mongo admin --eval "printjson(db.runCommand( { replSetGetStatus : 1 } ))" | grep "state"
results in :
"state" : 1,
"stateStr" : "PRIMARY",
"state" : 2,
"stateStr" : "SECONDARY",
"state" : 2,
"stateStr" : "SECONDARY",
This server is a linux box so i have limited access to the box for testing. In the health explorer on the mongodb test server, it shows the monitor as healthy.
in the monitor error expression I have set //*[local-name()="StdOut"] contains error
in the monitor healthy expression I have set //*[local-name()="StdOut"] contains errorlog
So clearly this monitor should be in an error condition based on the shell command results.
I am not sure if the shell command is running or not.
How can I see if the shell command is running and what it is producing for this linux shell command monitor?
Thanks Lance