Welcome to MSDN Blogs Sign in | Join | Help

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.

Published Friday, June 20, 2008 11:27 PM by Boris Yanushpolsky
Filed under:

Attachment(s): CreatePortMonitoring.ps1.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# a-foton » Blog Archive » Automating port monitoring using PowerShell

# Operations Manager Utility: MPViewer 1.6 - Exporting to Excel

Saturday, June 21, 2008 9:29 AM by Scott Moss at myITforum.com

This is so sweet! This new version of MP Viewer allows you to export data to Excel in addition to the

# Boris provides a script to automate OpsMgr port monitoring with PowerShell

Monday, June 23, 2008 4:04 PM by Rod Trent at myITforum.com

# re: Automating port monitoring using PowerShell

Tuesday, June 24, 2008 11:17 AM by JoeC

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

# re: Automating port monitoring using PowerShell

Tuesday, June 24, 2008 11:26 AM by Boris Yanushpolsky

Hi JoeC,

Can you send me an email offline with info about the services you need to monitor. There might be some other solutions.

# A Great place for SCOM scripts

Thursday, August 21, 2008 12:41 PM by Dario IT Solutions Blog

Check out Boris Yanushpolsky's blog ( http://blogs.msdn.com/boris_yanushpolsky ). Boris is an SCOM

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker