Due to a question on the forum and many people are still struggling with setting up SNMP here a quick guide on the following SNMP issue’s:
How to Setup SNMP on both SCOM and the Network device or Windows Server.
How to create a custom class based on Network Device and how to discover it.
The example MP is attached at the bottom of this post.
This part is where most of the problems start. Because of wrongly configured SNMP Settings the devices never get discovered in the first place.
First you need to make sure SNMP is setup correctly on both the SCOM Management server and the Windows Server or Device you want to discover. Without the correct setup we are not going to discover anything
First some details on SNMP:
Wikipedia – SNMP operates in the Application Layer of the Internet Protocol Suite (Layer 7 of the OSI model). The SNMP agent receives requests on UDP port 161. The manager may send requests from any available source port to port 161 in the agent. The agent response will be sent back to the source port on the manager. The manager receives notifications (Traps and Inform Requests) on port 162. The agent may generate notifications from any available port
Basically our SCOM management server will act as a SNMP Manager and our device is going to act as a SNMP agent.
SNMP in detail on TechNet
SNMP on Windows 2003 from the Knowledgebase
Maybe obvious but always make sure you can communicate by port UDP 161 and 162 between the SCOM Server and the Windows Server or Device.
SNMP Setup SCOM Server
For easy understanding we are going to use the example above.
On the SCOM Server SCOM2007.mydomain.local
First we need to install / add the SNMP components to SCOM2007.mydomain.local.
|Windows 2003||Windows 2008|
|Make sure you have access to the Windows 2003 Installation Source. (i386)||To install SNMP on Windows 2008 you will need to use server manager and add the SNMP Service feature.|
After the installation you will have the following services on the SCOM Server:
You can leave the default settings.
SNMP Managed Devices
Network Device / other SNMP Device
When you want to add a network device you will also need to configure SNMP on the Device. How to do this will differ by device, most of the times you can find help on changing these settings in the manual of your device.
When you know how to you will simply need to add the SCOM Server, SCOM2007.mydomain.local or 10.10.10.10 and its community name scomtestsnmp on the device to be able to discover it by the use of SNMP.
*****TIP! Always make sure you know the version of SNMP your device is using. SCOM 2007 R2 Supports both SNMPv1 and SNMPv2. SNMPv3 is not supported in the current version we will have to wait until VNext. When running a Network Device discovery you need to specify the SNMP Version make sure you use the correct one otherwise discovery will fail.
Windows Server by SNMP
Win2003.mydomain.local or 10.10.10.30
(Settings apply to both Windows 2003 as well as Windows 2008.)
*****TIP! When using 2008 always make sure the Windows Firewall has exceptions for SNMP Traffic.
When you want to add a windows server to your SCOM environment by the use of SNMP. You should also install the SNMP Service like we did at the SCOM server.
After the Installation You need to Adjust the SNMP Settings to allow the SCOM Server,SCOM2007.mydomain.local, to communicate with the Windows Server,Win2003.mydomain.local.
Simply navigate to the SNMP Service run—>Services.msc\SNMP Service
Select the properties and navigate to the Security tab and add the SCOM Server IP Address or Hostname and add the Community name you want to use.
In our Example we are going to use:
Community String scomtestsnmp
SCOM Server IP is 10.10.10.10 or hostname SCOM2007.mydomain.local
Configuring these settings on the Windows server you want to discover by SNMP, Win2003.mydomain.local, allows the SCOM Server to talk SNMP to the Windows 2003 Server ! Without these settings the windows server will never be discovered as a SNMP Device…..
If you followed the above procedures you should be able to now discover your SNMP enabled devices. When discovering these devices you are able to use the basic monitoring rules default to SCOM to monitor your device.
Next we are going to use the authoring console to configure a custom class and how we can discover the class and any additional properties.
Like stated this one is based on a forum post / question. Therefore I will use the same Management Pack and approach.
The approach was to discover an Application running on Windows 2003 that uses it’s own MIB.
Because monitoring requires to send SNMP get requests to check for a state
Create Management Pack
Create a Empty management pack named: XYZ.Management.Pack
On the properties tab of the management pack make sure you have the correct mp references:
If they are not present please add them.
Create a class named MyApp – XYZ.Management.Pack.Class.MyApp set the base class to be Microsoft.SystemCenter.NetworkDevice.
Because the Base class is Microsoft.SystemCenter.NetworkDevice it will automatically inherit al the Network Device properties.
Add a new property called Version to the class and don’t forget the displayname
Create the Datasource for the Discovery
Create a Datasource named XYZ.Management.Pack.DataSource.Discovery.MyApp
|Scheduler – System.Discovery.Scheduler||SNMPGetProbe – System.SNMPProbe||Mapper – System.Discovery.ClassSnapshotDataMapper|
How the datasource works:
If you want to discover more properties you can add them to the SNMPprobe Module.
The easiest way is to copy the XML and change the OID you want to query.
The ISwriteAction will always be false since we wan to do a SNMP get and not a SET!
Create Discovery Rule
Create a Custom discovery Rule called XYZ.Management.Pack.Discovery.MyApp
Target the discovery at Microsoft.SystemCenter.NetworkDevice
For Discovered Classes select the MyApp Class – XYZ.Management.Pack.Class.MyApp
At the configuration tab you need to browse for the datasource, XYZ.Management.Pack.DataSource.Discovery.MyApp, you just created and select it.
Create Monitors / Rules links
After discovering our custom class for the application we are now able to create rules and monitors target to the class.
Since the creation of rules and monitors really depend on How you want to monitor your application or device here are links from basic to advanced on how to setup monitoring.
System Center Central
SNMP Series by Pete Zerger
SNMP Support of Devices by Pete Zerger
SNMP Probe Based Monitors by David Allen
SNMP Device simulator by Jalasoft
SNMP Management Pack Example – NetApp by Oskar Landman
How to create a SNMP Probe-Based Unit Monitor in Operations manager 2007
How to Create a Monitor for SNMP Traps in Operations manager 2007
How to Create a SNMP Performance Collection Rule in Operations manager 2007
How to Create a SNMP Trap Event Collection rule in Operations Manager 2007
How to Create a SNMP Event Collection Rule in Operations Manager 2007
How to Create an Alert-Generating SNMP-Trap-Based Rule in Operations manager 2007