MIB examples

SNMP examples

Using snmpwalk

1.The snmpwalk command allows you to list all of the OID objects that are possible:

snmpwalk -v 2c -c public -m all -Os 192.168.1.1 iso

You can optionally collect the results into a file for easier review. You can save this file and use it as a guide of the Colubris OID objects.

snmpwalk -v 2c -c public -m all -Os 192.168.1.1 iso > snmp.txt

You can also specify a lower starting point on the snmp tree instead of the top, (iso):

snmpwalk -v 2c -c public -m all -Os 192.168.1.1 certificateExpiryDate

2.You can display the numeric equivalent for an object name:

snmpwalk -v 2c -c public -m all -On 192.168.1.1 certificateExpiryDate

3.Given the object's numeric value, you can retrieve the object's descriptive name:

snmpwalk -v 2c -c public -m all -Os 192.168.1.1 .1.3.6.1.4.1.8744.5.2.1.3.3.0

4.You can override the default MIBDIRS environment value by specifying another MIB path:

snmpwalk -v 2c -c public -m all -M c:\net-snmp\usr\mibs-build-bbbb -Os 192.168.1.1 iso

Using snmpget

The snmpget command is similar to snmpwalk, except that it retrieves only the value of the object specified, not the rest of the objects on that branch.

1.This command allows you to list the value for the sysDescr.0 OID object:

snmpget -v 2c -c public -m all -Os 192.168.1.1 sysDescr.0

2.You can optionally collect the results into a file for easier review, (i.e. object.txt):

snmpget -v 2c -c public -m all -Os 192.168.1.1 sysDescr.0 > object.txt

3.This command allows you to list the value for the certificateExpiryDate.0 OID object:

snmpget -v 2c -c public -m all -Os 192.168.1.1 certificateExpiryDate.0

4.To see the numeric equivalent for an object name:

snmpget -v 2c -c public -m all -On 192.168.1.1 certificateExpiryDate.0

5.Given the OID object's numeric value, you can retrieve the object's descriptive name:

snmpget -v 2c -c public -m all -Os 192.168.1.1 .1.3.6.1.4.1.8744.5.2.1.3.3.0

6.You can override the default MIBDIRS environment value by specifying another MIB path:

snmpget -v 2c -c public -m all -M c:\net-snmp\usr\mibs -Os 192.168.1.1 sysDescr.0

2-5

Page 25
Image 25
HP Guest Management Software manual Using snmpwalk