retrieve an SNMP table and display it in tabular form 



snmptable [COMMON_OPTIONS] [-Cb] [-CB] [-Ch] [-CH] [-Ci] [-Cc CHARS] [-Cf STRING] [-Cw WIDTH] AGENT TABLE-OID


The snmptable utility is an SNMP application that repeatedly uses the SNMP GETNEXT or GETBULK requests to query for information on a network entity. The parameter TABLE-OID must specify an SNMP table.

AGENT identifies a target SNMP agent, which is instrumented to monitor the gievn objects. At its simplest, the AGENT specification will consist of a hostname or an IPv4 address. In this situation, the command will attempt communication with the agent, using UDP/IPv4 to port 161 of the given target host. See snmpcmd for a full list of the possible formats for AGENT.



Displays only a brief heading. Any common prefix of the table field names will be deleted.


Does not use GETBULK requests to retrieve data, only GETNEXT.


Print table in columns of CHARS characters width.


Uses the string STRING to separate table columns. With this option, each table entry will be printed in compact form, just with the string given to separate the columns (useful if you want to import it into a database). Otherwise it is printed in nicely aligned columns.


Displays only the column headings.


Does not display the column headings.


Prepends the index of the entry to all printed lines.


For GETBULK requests, REPEATERS specifies the max-repeaters value to use. For GETNEXT requests, REPEATERS specifies the number of entries to retrieve at a time.


Specifies the width of the lines when the table is printed. If the lines will be longer, the table will be printed in sections of at most WIDTH characters.

In addition to these options, snmptable takes the common options described in the snmpcmd reference page.

Note that snmptable REQUIRES an argument specifying the agent to query and exactly one OID argument, as described in the snmpcmd manual page. This OID must be that of a MIB table object.


$ snmptable -v 2c -c public localhost at.atTable

SNMP table: at.atTable RFC1213-MIB::atTable

atIfIndex   atPhysAddress   atNetAddress
               1  8:0:20:20:0:ab
$ snmptable -v 2c -c public -Cf + localhost at.atTable

SNMP table: at.atTable

atIfIndex+atPhysAddress+atNetAddress 1+8:0:20:20:0:ab+
$ snmptable -v 2c -c public -Cl -CB -Ci -OX -Cb -Cc 16 -Cw 64 localhost ifTable
SNMP table: ifTable
Index           Descr           Type            Mtu             
Speed           PhysAddress     AdminStatus     OperStatus      
LastChange      InOctets        InUcastPkts     InNUcastPkts    
InDiscards      InErrors        InUnknownProtos OutOctets       
OutUcastPkts    OutNUcastPkts   OutDiscards     OutErrors       
OutQLen         Specific        
index: [1]
1               lo              softwareLoopbac 16436           
10000000                        up              up              
?               2837283786      3052466         ?               
0               0               ?               2837283786      
3052466         ?               0               0               
0               zeroDotZero     
index: [2]
2               eth0            ethernetCsmacd  1500            
10000000        0:5:5d:d1:f7:cf up              up              
?               2052604234      44252973        ?               
0               0               ?               149778187       
65897282        ?               0               0               
0               zeroDotZero     


The test for TABLE-OID actually specifying a table is rather heuristic. Note also that the test requires the defining MIB file to be loaded.


All UNIX systems. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


snmp_variables, snmpcmd

PTC MKS Toolkit 10.4 Documentation Build 39.