snmptable Command
The snmptable command retrieves the contents of an SNMP table and displays the contents in a tabular format, that is, one table row at a time, such that the resulting output resembles the table being retrieved. This is contrasted with the snmpwalk command, which displays the contents of the table one column at a time.
Here is an example of the snmptable command:
% snmptable SNMP_agent sysORTable SNMP table: SNMPv2-MIB::sysORTable sysORID sysORDescr sysORUpTime IF-MIB::ifMIB The MIB module to 0:0:00:00.01 describe generic objects SNMPv2-MIB::snmpMIB The MIB module for SNMPv2 0:0:00:00.02 for network interface entities. TCP-MIB::tcpMIB The MIB module for 0:0:00:00.02 sub-layers. managing TCP UDP implementations. UDP-MIB::udpMIB The MIB module for managing 0:0:00:00.02 RFC1213-MIB::ip The MIB module for managing 0:0:00:00.02 implementations. SNMP-VIEW-BASED-ACM- View-based Access Control 0:0:00:00.02 SNMP-FRAMEWORK-MIB:: The SNMP Management 0:0:00:00.14 IP and ICMP implementations. MIB::vacmBasicGroup Model for SNMP. snmpFrameworkMIB Architecture MIB. Compliance SNMP-MPD-MIB::snmp The MIB for Message 0:0:00:00.14 MPDCompliance Processing and Dispatching. SNMP-USER-BASED-SM- The management information 0:0:00:00.14 MIB::usmMIBCompliance definitions for the SNMP User-based Security Model.
Note:
While thesnmpget, snmpgetnext, and snmpwalk command can be used on any type of MIB object, the snmptable command can be used only on MIB table objects. If this command is given any other type of object ID, it will be rejected. This restriction applies to a table entry object, a table column object, and any object that represents information within a table. Only a MIB table object ID can be used with the snmptable command.
In the examples of the snmptable command, the -Ci and -Cb options are used. For example, here is an snmptable command with the -Ci option:
% snmptable -Ci SNMP_agent sunPlatFanTable SNMP table: SUN-PLATFORM-MIB::sunPlatFanTable index sunPlatFanClass 10 fan 11 fan 17 fan 23 fan 29 fan 30 fan 36 fan 42 fan
Here is an example of an snmptable command without the -Ci option. Notice that the index column is not displayed:
% snmptable SNMP_agent sunPlatFanTable SNMP table: SUN-PLATFORM-MIB::sunPlatFanTable sunPlatFanClass fan fan fan fan fan
Here is an example of an snmptable command with the -Ci and -Cb options. The output is abbreviated.
% snmptable -Ci -Cb SNMP_agent entPhysicalTable
index Descr VendorType ContainedIn
SNMP table: ENTITY ?SNMPv2- 0 chassis
-MIB::entPhysical SMI:zeroDotZero
1
Table
Here is an example of the same snmptable command with the -Ci option but without the -Cb option. Again the output is abbreviated. Notice that the name of the MIB object is repeated on each heading.
% snmptable -Ci SNMP_agent entPhysicalTable
index entPhysicalDescr entPhysical entPhysical
VendorType ContainedIn
SNMP table: ENTITY ?SNMPv2- 0 chassis
1
-MIB::entPhysical SMI:zeroDotZero
Here is an example of an snmptable command using version 3 of the SNMP protocol:
% snmptable -Cb -Ci -mALL -v3 -aMD5 -utestuser -Apassword -lauthNoPriv SNMP_agent:port sunPlatPowerSupplyTable SNMP table: SUN-PLATFORM-MIB::sunPlatPowerSupplyTable index sunPlatPowerSupplyClass 90 powerSupply 92 powerSupply 96 powerSupply
The following snmptable command returns an empty table.
% snmptable -Cb -Ci SNMP_agent sunPlatBatteryTable SUN-PLATFORM-MIB::sunPlatBatteryTable: No entries