![]() You are now ready for testing, so give your new monitor a spin for its money and see if you gain value after adding this. Now Override the monitor for a specific object of class – And select the server you want to run the code on (pref another server than the fileserver it self). Right click your monitor and select Overrides. Now the MP is done, and you should see your monitor under Windows-computer Entity Health -> Availability. Select Priority and Severity as you see fit. Under the Alerting tab, give the alert a name that matches the alert – and give a good description to the alert aswell. If you want the Health State to be shown as Critical, please select that under the Health Tab. $PropertyBag = $ScomAPI.CreatePropertyBag()Īgain like before, instead of a screen output we give SCOM the value in the field STATE – and I’ve chosen to give it the following states Healthy YES and Unhealthy NO. $ScomAPI = New-Object -comObject "MOM.ScriptAPI" Set the timeout to a couple of minutes (i generally use 5 minutes).ĭelete the text in the script area, and put in the following script (edit as you desire) So like the naming on the general tab, give it a meaningful name. First give the script a name, and make sure you know what the script is doing if someone asks you about it. Now its time to make SCOM understand the script we created. MAKE SURE NOT TO ENABLE THE MONITOR – we will do this in the end. (Please do not choose it to run every 5 seconds, since your database will fill up with data you dont need). Name the script something apropriate on the General tab, then create a schedule on how often you want this script to run. Select Scripting -> Powershell Based -> Powershell Script Two State Monitor, and create a new/select an existing MP to put this monitor into. Now we need to import this code into SCOM, and make sure that you get alerts when/if the state changes.įirst, create a new Windows-computer Availability Unit Monitor. (In this example you need to change the share names into your own shares) Now I should get an output ‘Folder is alive’ if the folders are accessable, and ‘Folder is dead’ if not. This is hardcoded, but can easily be changed.īefore doing this I just want to make a disclaimer saying, that I am not responsible for any of this code – I encourage you to test this in a non-production enviorenment before anything else. I started off by creating my powershell script – I wanted to keep it simple, so that the next guy could see what I have been doing. I’ve had this MP for a while, but never really used it so its about time. ![]() (And we hate that!) So i decided to give it a go with the SquaredUp Community Powershell Monitoring Management Pack. We had a VBscript that monitored if our fileshares were up or down, but recently it started to fail – giving false positives. First of all, its been a while – but I am still here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |