SCOM: A Net-SNMP Management Pack for UNIX Monitoring, Part I – Desiging the MP
September 19, 2009 4 Comments
The Net-SNMP agent is a cross-platform SNMP agent that is often bundled with UNIX (e.g. Solaris) and Linux distributions (including VMWare and Checkpoint Splat). The agent implements some relatively standard MIBs, such as the UC Davis (UCD-SNMP-MIB) and HOST-RESOURCES MIBs, exposing a good selection of operating system metrics for monitoring. Furthermore, the agent is remarkably extensible in a few different ways. The agent can be extended with “dlMod” module extensions to integrate additional SNMP components, such as the VMWare or HP Insight Management Agent modules. Additionally, the Net-SNMP agent can be configured to proxy for another SNMP agent listening on a different port, which is how the Sun SunFire Management Agent is typically configured. Lastly, the Net-SNMP agent provides the ability to define processes, files, extensible objects, load average objects, and disks for specific monitoring. For each of these, directives are configured in snmpd.conf with parameters and thresholds, and an SNMP table is exposed that will return the monitored value and status value to an SNMP poll, on-demand. I had previously posted an article on using the ext (Extensible Object/Arbitrary Extension) capabilities of the Net-SNMP agent to utilize shell scripts for monitoring of Sun hardware. With this degree of flexibility, it’s easy to understand why the Net-SNMP agent is so widely utilized.
Design Approach for the Net-SNMP Management Pack
Building on the lessons learned from developing the Cisco Management Pack, I wanted to create a management pack with similar capabilities for monitoring of Net-SNMP agents, followed by a set of management packs for monitoring of vendor-specific hardware (e.g. HP Proliant servers running Linux). After some thought, I decided that it would be advantageous to split the Net-SNMP management pack into two separate management packs, one that defines the base classes and performs discovery of the classes and one for the actual monitoring. The reason for this is that I wanted a base management pack without any actual monitoring functions so that it could easily (and more flexibly) be reused for future hardware monitoring management packs. To illustrate this point, if the native UNIX agent capabilities of R2 are being used to monitor OS-level objects, there is still a need to discover the Net-SNMP agent and create base classes for use in SNMP-based hardware monitoring, but in this case, monitoring OS-level objects with SNMP and the OpsMgr agent would be redundant. With the multiple MP approach, just the base Net-SNMP management pack could be imported along with the hardware monitoring management packs, skipping the Net-SNMP monitoring management pack altogether. Additionally, I wanted to leave the monitoring management pack unsealed for easy customization, and MP references can only be made to sealed management packs. In this way, the Net-SNMP Library MP will be sealed, but the monitoring MP can remain unsealed.
The Net-SNMP Library Management Pack
As described above, this management pack just defines the Net-SNMP object classes and performs the discovery of these objects. The discovery methodology is pretty much the same as in the Cisco Management Pack, but I did do some things a bit differently. Most notably, I added an additional layer of classes in the containment hierarchy. In this management pack, the Net-SNMP Device class hosts a set of containment classes such as Network Interfaces, Volumes, and Monitored Processes. These classes in turn host the actual objects to be monitored: Network Interface, Volume, and Monitored Process. My motivation for this was primarily to keep the object relationships more neatly organized, particularly when viewing the objects in a Diagram View. This does add a slight degree of complexity, but I think the benefits of having a more usable Diagram View justify the additional complexity.
I chose to create hosted classes for the following objects: Network Interfaces, Volumes (logical disks and memory pools from the hrStorage table), Monitored Processes, Monitored Files, and Monitored Extensible Objects. I ignored the customizable Load Average and Disk monitoring capabilities of the Net-SNMP agent because those objects can be monitored through existing SNMP objects in the UCD-SNMP and HOST-RESOURCES MIBs and I wanted to keep the monitoring configuration within OpsMgr as much as possible (instead of in the agent snmpd.conf). The Files, Processes, and Extensible Objects monitoring capabilities of the Net-SNMP agent cannot easily be replicated with other SNMP monitors, so I included those to maintain a high degree of monitoring extensibility.
The class diagram for the Net-SNMP Library MP is:
With just the NetSNMP.Library MP imported, the Diagram View is a pretty good demonstration of the MP in action: