If you need to query a device that supports the Simple Network Management Protocol (SNMP), you can do so from a command line interface, i.e, a shell prompt, on a Mac OS X or Linux system using the snmptest tool. To use the utility, issue the snmptest command specifying the "community string", which is somewhat equivalent to a password, with the
-c
option, specify the version of SNMP with the
-v
option and then specify the IP address or
fully qualified domain name (FQDN). You will get
a "Variable:" prompt when you run the command. You can specify an
object identifider (OID) that you wish to query at that prompt. If
you hit Enter the prompt will be repeated. When you've finished
entering variables you wish to query, hit Enter at the next
"Variable" prompt without entering any variable. You should then see
the results returned as shown below. You can hit Ctrl-C to terminate
the program.# snmptest -c SomeSecret0123 -v 1 192.168.0.11 Variable: system.sysLocation.0 Variable: system.sysContact.0 Variable: Received Get Response from UDP: [192.168.0.11]:161->[0.0.0.0]:41231 requestid 0xAF07FC2 errstat 0x0 errindex 0x0 SNMPv2-MIB::sysLocation.0 = STRING: London SNMPv2-MIB::sysContact.0 = STRING: John Doe Variable: ^C #
[ More Info ]