What is a MIB
A MIB is a Management Information Base. It is an index based upon a network standard that categorizes data for a specific device so that SNMP servers can read the data.
Where to Obtain VMware vSphere MIBs
VMware MIBs are specific to VMware Version, you can try to use the ESX MIBs for ESXi. They can be downloaded from http://downloads.vmware.com. Click on VMware vSphere > find the version of ESX that you are running under “Other versions of VMware vSphere” (the latest version will be the page that you’re on). Click on “Drivers & Tools”. Then click on “VMware vSphere x SNMP MIBs” where “x” is your version.
How to add VMware vSphere MIBs into Nagios
- Download the VMware vSphere MIBs from http://downloads.vmware.com
- Copy the MIB files to /usr/share/snmp/mibs/
- Run check_snmp -m ALL so it detects the new MIBs
Editing snmpd.conf and starting snmpd on ESX
- Stop snmpd: service snmpd stop
- Backup snmp.xml: cp /etc/vmware/snmp.xml /etc/vmware/snmp.xml.old
- Edit snmp.xml with your favorite CLI text editor to have the following:
- Backup snmpd.conf: cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old
- Use your favorite CLI text editor and edit /etc/snmp/snmpd.conf
- Erase everything in it.
- Add in the following and save it:
load 99 99 99
syscontact “ESX Administrator”
view systemview included .18.104.22.168.4.1.6876
proxy -v 1 -c public 127.0.0.1:171 .22.214.171.124.4.1.6876
- Change “syslocation” and “syscontact” to whatever you want
- Save your work
- Configure snmpd to autostart: chkconfig snmpd on
- Allow SNMP through firewall: esxcfg-firewall –e snmpd
- Start the SNMP daemon: service snmpd start
- Restart the mgmt-vmware service: service mgmt-vmware restart
OID’s are MIB specific variables that you can instruct an SNMP server monitor to look for. These variables can be determined by reading the MIBs. One tool that assists with doing this is MIB Browser by iReasoning Networks http://tl1.ireasoning.com/mibbrowser.shtml. MIB Browser can run on Windows, Mac OS X, and Linux/UNIX. To obtain the appropriate OID’s:
- Load the MIBs in MIB Browser by going to File > Load Mibs
- Manually comb through to find the OID you want (it will be connected to a string that will be similar to wording used in VSphere).
- SNMP MIBs was downloaded from http://downloads.vmware.com for ESX 4.1
- Loaded MIB for VMWARE-RESOURCES-MIB into MIB Browser
- Searched for “Mem” (Edit > Find in MIB Tree), found “vmwMemAvail”, the OID for this is .126.96.36.199.4.1.68188.8.131.52.0 (use the OID shown in the dropdown that is near the menu in the MIB Browser – it will show the full OID which will sometimes include a “0″ at the end that the OID listed towards the bottom of the window will not)
- Add OID into remotehost.cfg (or linux config file) file in Nagios
use generic-service ; Inherit values from a template
service_description Memory Available
check_command check_snmp!-C public -o .184.108.40.206.4.1.68220.127.116.11.0 -m all
host_name: the name of the device (whatever you want to call it)
service_description: the name of the service you are monitoring (whatever you want to call it)
check_command: -C is to define the community SNMP string, -o is to define the OID to read, -m is to define which MIB files to load – to be more specific, for this example you can narrow “-m all” to “-m VMWARE-RESOURCES-MIB.MIB”
Once you’ve done the above you should be able to monitor “Memory Available” for ESX through Nagios. Repeat the procedure, changing steps where applicable for the specific OID you want to monitor. If you have questions, or need assistance, please contact 318, Inc. at 1-877-318-1318.