Custom Monitor Health State Troubleshooting Techniques

Hi,

I have created a Custom Timed Script 2-state Monitor through Ops Console in SCOM 2012 SP1 and the health state is misbehaving and remains Healthy always, even while the unhealthy expression should be evaluated as True.

I have confirmed the monitor is targeted to class IIS FTP Server, as the monitor appears in Health Explorer for FTP Server and is displayed as enabled.

I have used LogScriptEvent in the script to write an event of the results of the script on the agent and the value that will be passed back to the SCOM server, so I also know the script is executing and generating the correct results.

The script returns a numeric value, either 0 or a positive value (ie. no negative value number).

The healthy expression is = 0.  The unhealthy expression is > 0.

The returned value represents the number of missing files and when it is for example 12, the health state is not changing to unhealthy and no alert is generated.

I have updated the MP version and confirmed the agent receives the latest version.

I have flushed the agent health state.

I have reset and recalculated the monitor.

I have reviewed agent and server event logs and do not see any related errors.

I have used a simple alert description in case it itself had an error and was preventing a healthy state change.

I have review the xml and see no issue. I updated the monitor xml manually to receive and compare the script value as an integer (instead of the default string type that the gui creates).

I wish I knew how to see the results of the SCOM workflow that determines if a health state change is required.

My next steps in the absence of a better action plan, is to reverse the healthy/unhealthy expressions to see what happens or recreate the MP from scratch.

Any help would be greatly appreciated as I have been banging my head on this one!!

September 16th, 2014 11:35am

I think that the returned value is a string,  not INT and there's no way to cast it as an INT. Do the logic in the script to say State=good or State=bad and then use that healthy/degraded state.
Free Windows Admin Tool Kit Click here and download it now
September 16th, 2014 12:36pm

Thanks for the response Andy.

Actually, you are only partially correct. The returned value IS a string by default, however you CAN cast it as an Integer if you export the MP to xml, substitute value String with Integer, and reimport the MP.

Root cause of the issue turned out to be a typo in the parameter syntax used in the health expression.

It was an easy catch once I compared side-by-side a working monitoring against the unworking monitor.  Good example of how going too fast can actually slow you down :)

Thanks again for taking the time to respond!

September 29th, 2014 9:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics