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!!