Automating port monitoring using PowerShell
A while I wrote a blog entry about how you can automate the creation of URL monitoring logic in OpsMgr using PowerShell. One of the questions I have received is "how do you do the same thing for port monitoring ?". Attached is a script that demonstrates how this can be done.
In order to run the script, you need to open the OpsMgr Command Shell and run the following:
CreatePortMonitoring.ps1 -serverName:'TargetServerName.contoso.com' -portNumber:'80' -pollIntervalSeconds:'120' -watcherNodes:"watcher1.contoso.com", "watcher2.contoso.com" -displayName:'Test URL monitoring' -targetMP:'Port Monitoring MP'
Note: If you specify the interval less than 1 minute, the monitoring should still work but you will not be able to load the configuration page and will see a UI error.....
In one of my future posts I will try to explain how this scripts works for those of you who want to automate execution of MP templates.
Comments
- Anonymous
June 20, 2008
PingBack from http://blog.a-foton.ru/2008/06/21/automating-port-monitoring-using-powershell/ - Anonymous
June 21, 2008
This is so sweet! This new version of MP Viewer allows you to export data to Excel in addition to the - Anonymous
June 23, 2008
Nice job! Post: http://blogs.msdn.com/boris_yanushpolsky/archive/2008/06/20/automating-port-monitoring - Anonymous
June 24, 2008
Can you provide the one for a Windows Service using the Management Pack Template? I think that one would be the most valuable as I have 217 services in my environment.. - Anonymous
June 24, 2008
Hi JoeC,Can you send me an email offline with info about the services you need to monitor. There might be some other solutions. - Anonymous
August 21, 2008
Check out Boris Yanushpolsky's blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM - Anonymous
March 24, 2009
The comment has been removed