Hello Guys,
I have created one script based monitor to log the nic teaming status. It works though, creates the alert as well, but doesn't close it once the monitor health is "Healthy". I have added 2 lines on script which logs an event also when script runs and completes. Below is the script.
< #Load the MOMScript API and the PropertyBag Provider
$api = New-Object -ComObject "MOM.ScriptAPI"
$propertyBag = $api.CreatePropertyBag()
#Log an Event that our script is starting
$api.LogScriptEvent("Teaming12.ps1",3375,0,"Nicteaming on Hyper-V is starting")
#MainScript
$NicTeamingStatus = (Get-NetLbfoTeam -Name "Team1").status
#Log and Event that our script is complete
$api.LogScriptEvent("Teaming12.ps1",3376,0,"Nicteaming on Hyper-V is Complete - $NicTeamingStatus")
#Output the Propertybag data for Scom Consumption:
$propertyBag.AddValue("NicTeamingStatus",$NicTeamingStatus)
$propertybag
>
Parent Monitor: Configuration
Schedule : 5 minutes
Unhealthy expression:
Property[@Name='NicTeamingStatus'] <Operator-Does not equal> <Value- Up>
Healthy Expression:
Property[@Name='NicTeamingStatus'] <Operator-equals> <Value- Up>
** I have this Powershell 2 state monitor configured on Target "Windows Server" in disabled state, enabled it through override to target only one Physical server. I am geting alert from that physical server, monitor logs events also on that server. But doesn't closet the alert once teaming status is UP / monitor health is healthy.
Can someone help me , what i am doing wrong here.

