About these ads

David Vassallo's Blog

If at first you don't succeed; call it version 1.0

Importing custom SNMP MIBS to Nagios


In some network enviornments, it is often necessary to import vendor specific SNMP MIB. A MIB is an information database which contains all the SNMP “variables” that can be read from a particular node. It goes without saying, that different nodes will have different SNMP capabilities. Most of these are standardised and can be retrieved by any SNMP server, but some a vendor-specific and in order to read these SNMP values the vendor release their own MIBS which need to be imported into the SNMP server

In our testlab network, we monitor the number of connections present on our gateway. This particular value is not present in the standard SNMP MIBs.

In nagios the procedure was actually pretty simple.

1. Downloaded the sonicwall MIBs from their website

2. Since Nagios uses NetSNMP, just copy the MIB files into /usr/share/snmp/mibs.

3. “check_snmp” is run with “-m ALL”  and it detects the new mib

Furthering my example, all that is needed is to find the correct “variable” (formally referred to as OID in SNMP parlance) and instruct check_snmp to read that. I downloaded a MIB reader, in may case the iReasoning MIB reader (available free over here). Once the MIB browser was installed and downloaded, load the sonciwall MIB files (File > Load Mibs) and search around for the correct OID. In my case, the “Current Connection Cache” was located in

SONIWALL-FIREWALL-IP-STATISTICS > sonicwallFw > sonicwallFwStatsModule > sonicwallFwStats > sonicCurrentConnCacheEntries.

I made a node of the numerical OID : .1.3.6.1.4.1.8741.1.3.1.2.0

From here its just a matter of feeding the OID into the check_snmp command in the switch.cfg file in nagios:

define service{
use                                       generic-service ; Inherit values from a template
host_name                       UK-TL-Gateway
service_description     Number of Connections
check_command           check_snmp!-C public -o .1.3.6.1.4.1.8741.1.3.1.2.0 -m all
}

Note the actual check_snmp command uses -C swtich to define the community SNMP string to read values, the -o switch to define the OID to read, and the -m switch to define which MIB files to load

About these ads

2 responses to “Importing custom SNMP MIBS to Nagios

  1. Pingback: 2010 in review « Dvas0004's Blog

  2. Pingback: Installing Cacti & MRTG « Dvas0004's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 158 other followers

%d bloggers like this: