Snmpwalk Command Line Examples
SNMP protocol provides useful features to monitor and configure network and server systems remotely. Monitoring features are much popular than configuration.
snmpwalk is a function provided by SNMP protocol to get metrics of remote system in bulk.
Get All OIDS
We will first look the simplest usage of the
snmpwalk command. We just provide minimum options to the
snmpwalk. We will provide following options as minimum
-v 2cversion information 2 community
-cthe public or private secret
$ snmpwalk -v 2c -c public localhost
Get Specific OIDS
In previous example we have listed all existing and configured OIDs. But this is not useful for all cases. We may need to filter and specify only OIDS we need. We will add to the end of the command the OIDs we want to get. In this example we only want OID of contact information.
$ snmpwalk -v 2c -c public localhost iso.18.104.22.168.22.214.171.124
Specify MIB Library Path For External MIBs
Normally Linux provide a lot of default MIBs but in some cases the remote system vendor may provide 3rd party MIBs. We can use these MIBs in order to get OIDs of remote system. We will specify the MIBs location with
$ snmpwalk -v 2c -c public -M /root/ismail/ciscoMIB localhost iso.126.96.36.199.188.8.131.52