snmpwalk
snmpwalk allows you to retrieve subtrees.
For more information on this subject, please consult the snmpwalk instructions page, available on the official Net-SNMP open-source repositories.
Example
The following command will retrieve all of the variables under system:
snmpwalk -Os -c public -v 1 zeus system
-Os
(parsing option) Print only last symbolic element of OID (OID = object identifier).
-c public
where public
is the community name.
-v 1
Will use 1st version of the SNMP protocol (community based).
zeus
Name of the target system.
system
OID name of the network entity.
snmpget and snmpset
snmpget is used to query for information on a network entity.
snmpset is used to set information on a network entity.
Examples
snmpget -c public zeus system.sysDescr.0
Will return value of sysDescr.0 OID if available.
snmpset -c private -v 1 test-hub system.sysContact.0 s dpz@noc.rutgers.edu
Will set sysContact.0 OID to the string value dpz@noc.rutgers.edu.
test-hub
Name of the target system.system.sysContact.0
OID of the object for which the value is to be set.
s
type of variable that is to be set (here: string)
New value.
snmptrap
snmptrap allows you to send an SNMP notification.
For more information on this subject, please consult the snmptrap instructions page, available on the official Net-SNMP open-source repositories.
Example
The following command will send a notification for OID sysDescr.0:
snmptrap -v 1 -c public zeus sysDescr.0
-v 1
Will use 1st version of the SNMP protocol (community based).
-c public
where public is the community name.
zeus
Name of the target system.
sysDescr.0
OID which you want to send as notification.