Linux – SNMPWALK extract UCD-SNMP-MIBs

linuxnetworkingsnmp

I am trying to use snmpwalk to get the MIB list and I couldn't get anything related to CPU, Load, Memory.

On further digging in I found that the UCD-SNMP-MIBs are the one which will return the information I require. But, I couldn't find anything on the snmpwalk output.

How to enable this in snmp configuration ? or any additional modules has to be configured ?

I am running smpwalk on CentOS box and my target host is a linux xen server. I have installed net-snmp, net-snmp-utils on my CentOS server.

Best Answer

When you snmpwalk a device using the net-snmp snmpwalk tool, it will not by default return anything in the enterprise MIBs, such as UCD-SNMP.

Enterprise MIBs are all the OIDs that start with .1.3.6.1.4.1.

You can work around this by specifying where on the OID tree to start walking, instead of returning the default parts of the tree

  snmpwalk -v2c -cpublic 10.8.0.1 .1.3.6.1.4.1

would walk the tree starting with 'enterprises.', which would return the UCD-SNMP-MIB with all that good information that you want.

You can also do

  snmpwalk -v2c -cpublic 10.8.0.1 .1

which says "start at .1" which is the top of the OID tree, and will return everything.

Now, many of the OIDs won't be translated into names. You have to ask snmpwalk to turn OIDs into names by parsing all of the non-default MIBs, you do that by adding '-mALL' to the command line

  snmpwalk -v2c -cpublic -mALL 10.8.0.1 .1

will return everything, with OIDs turned to names (where you have a copy of the MIB file in one of the default MIB directories).

HTH