SCOM: Test Network Device Discovery with PowerShell

Hi Readers,

Today we will focus on the SCOM Network Device Discovery process. Adding Network Devices in SCOM could be a challenge and time consuming, when an external team has to configure the device to authorize SCOM queries it.
In SCOM, You need to:

  • Create the Run As Account with the Community String
  • Create a Discovery Rule
  • Configure the Discovery settings and Account for the Device you want to add
  • Ensure that the Network device is well configured to let SCOM discover it

If you have a lot of devices and only one SCOM discovery rule, the discovery could take time….and now, if the device is missed configured, you have to re-do everything and wait wait wait….and test….
Let try to speed up this process by ensuring that the device that we want to discover is well configured for SCOM. For that, I wrote the little PowerShell script that you have to run on the MS that will discover and monitor the Network Device.

$IP = '10.15.5.67' #Ip of the network device you want to discover
$Community = 'SCOM_******' #Community string configured on the network device for the SCOM monitoring


$SNMP = new-object -ComObject olePrn.OleSNMP

$snmp.open($ip,$community)


Write-Host "SysName : "$snmp.Get(".1.3.6.1.2.1.1.5.0")

Write-Host "SysDescription : "$snmp.Get(".1.3.6.1.2.1.1.1.0")

Write-Host "SysObjectID : "$snmp.Get(".1.3.6.1.2.1.1.2.0")

Write-Host "SysContact : "$snmp.Get(".1.3.6.1.2.1.1.4.0")

Write-Host "SysLocation : "$snmp.Get(".1.3.6.1.2.1.1.6.0")


$SNMP.Close()

I targeted the script to a F5 load balancer, the output is below:

Now, that I’m sure that the Network Device is well configured, I could add it to SCOM J

You could of course improve this script by adding a loop for testing multiple devices, reading the devices list from a CSV file, …

I hope this help J

Cheers
Christopher

Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Email this to someoneShare on TumblrPin on PinterestDigg thisShare on RedditFlattr the authorBuffer this pageShare on StumbleUpon

About Christopher Keyaert

Christopher Keyaert is a Consultant, focused on helping partners to leverage the System Center and Microsoft Azure cloud platform. He is also a Microsoft Most Valuable Professional (MVP) for Cloud and Data Center Management and a Microsoft Certified Trainer (MCT).
This entry was posted in Operations Manager. Bookmark the permalink.

One Response to SCOM: Test Network Device Discovery with PowerShell

Leave a Reply

Your email address will not be published. Required fields are marked *