In this post I would like to show how to interact with Service Manager objects to get information from SNMP devices and put data back into Service Manager. A customer needed a solution to get serial numbers from different network devices into his Service Manager form to have the most valuable data available for those devices.
If you already using network monitoring in SCOM 2012 then you know that you get all kinds of data on the network object. Here an example of the properties of a switch in SCOM…
What SCOM not does, is discover other properties which might be useful e.g. the serial number of the device. The serial number is just another system object ID (OID) on the networking device which can differ between each vendor or even between model types from the same vendor. That means for a HP switch Pro Curve type A you will have a different OID for the serial number than for a HP switch Pro Curve type B.
Now how do I get the serial number into a Service Manager form?
First I have been discovering and monitoring all the network devices in SCOM 2012. As a next step I setup a connector from Service Manager to SCOM 2012 to import all these devices into a Service Manager. The Service Manager form is based on an extended Node class which has field Serial Number that is missing. It looks like this…
Let’s resume what we have. We have partial data of the network device in SCOM 2012 and the same data in Service Manager 2012. Now we need somehow to connect to the network devices, read the correct value and update the data in Service Manager. In my opinion a great task for Orchestrator 2012.
Log into a switch which is monitored by SCOM and find out what serial number this switch type has.
Because we don’t know which OID contains the serial number we need to dump all OID’s from the network device into a text file. The best way to do this is to use SNMPWalk.exe . You need to run the following command for your switch from step 1…
snmpwalk –r:[IP of the network device] –c:[read community string] > c:\temp\Switch.txt
Open the Switch.txt file in Notepad and search for the serial number from step 1. Use the find command to find your serial number in this file…
Notice here the OID=.188.8.131.52.184.108.40.206.220.127.116.11.1 is the number we are looking for.
If you look closely at the Service Manager form you will see that the exact type of the switch is in the description field.
Now starts the fun part. We are going to create a runbook which will get all the other serial numbers from the switches of the same type.
The runbook looks like this…
Note: I have used the Send Platform Event activity just for debugging purposes and I will not describe it. You might want to use it also in the beginning.
1. Get SCSM Network Object will get the object from Service Manager
2. Map Type to OID Data is used to get the Description field from the Service Manager object and the match a pattern ProCurve J4906A* to the OID 18.104.22.168.22.214.171.124.126.96.36.199.1 . Create an Output called OID which will contain the “serial number” OID for the different switch models. In our sample we have two different ProCurve switches.
3. From the Get SCSM Network Object activity you have the SNMP Agent Address which corresponds to the IP address of the switch. Provide this IP to the Get SNMP Variable activity as published data for the IP address. As Object identifier you use the OID published data from the previous activity.
4. On the Update SCSM Object activity use the SC Object GUID published data from the first Get SCSM Network Object activity to update the current object. Map the Serial Number field to the MIB value from the Get SNMP Variable activity.
5. Finally, if you start the runbook the value will be inserted…
Now you could schedule this runbook to run on a regular schedule. The downside of this approach is, that you need to figure out at least one time the OID for each network device and put it into the Map Type to OID Data activity.
But I think if you have lots of devices from the same type it will be a good way to keep your CMDB up to date with the serial number.