1SNMPTABLE(1) Net-SNMP SNMPTABLE(1)
2
3
4
6 snmptable - retrieve an SNMP table and display it in tabular form
7
9 snmptable [COMMON OPTIONS] [-Cb] [-CB] [-Ch] [-CH] [-Ci] [-Cf STRING]
10 [-Cw WIDTH] AGENT TABLE-OID
11
13 snmptable is an SNMP application that repeatedly uses the SNMP GETNEXT
14 or GETBULK requests to query for information on a network entity. The
15 parameter TABLE-OID must specify an SNMP table.
16
17 AGENT identifies a target SNMP agent, which is instrumented to monitor
18 the given objects. At its simplest, the AGENT specification will con‐
19 sist of a hostname or an IPv4 address. In this situation, the command
20 will attempt communication with the agent, using UDP/IPv4 to port 161
21 of the given target host. See snmpcmd(1) for a full list of the possi‐
22 ble formats for AGENT.
23
25 COMMON OPTIONS
26 Please see snmpcmd(1) for a list of possible values for COMMON
27 OPTIONS as well as their descriptions.
28
29 -Cb Display only a brief heading. Any common prefix of the table
30 field names will be deleted.
31
32 -CB Do not use GETBULK requests to retrieve data, only GETNEXT.
33
34 -Cc CHARS
35 Print table in columns of CHARS characters width.
36
37 -Cf STRING
38 The string STRING is used to separate table columns. With this
39 option, each table entry will be printed in compact form, just
40 with the string given to separate the columns (useful if you
41 want to import it into a database). Otherwise it is printed in
42 nicely aligned columns.
43
44 -Ch Display only the column headings.
45
46 -CH Do not display the column headings.
47
48 -Ci This option prepends the index of the entry to all printed
49 lines.
50
51 -Cl Left justify the data in each column.
52
53 -Cr REPEATERS
54 For GETBULK requests, REPEATERS specifies the max-repeaters
55 value to use. For GETNEXT requests, REPEATERS specifies the
56 number of entries to retrieve at a time.
57
58 -Cw WIDTH
59 Specifies the width of the lines when the table is printed. If
60 the lines will be longer, the table will be printed in sections
61 of at most WIDTH characters. If WIDTH is less than the length
62 of the contents of a single column, then that single column
63 will still be printed.
64
65 Note that snmptable REQUIRES an argument specifying the agent to query
66 and exactly one OID argument, as described in the snmpcmd(1) manual
67 page. This OID must be that of a MIB table object.
68
70 $ snmptable -v 2c -c public localhost at.atTable
71
72 SNMP table: at.atTable RFC1213-MIB::atTable
73
74 atIfIndex atPhysAddress atNetAddress
75 1 8:0:20:20:0:ab 130.225.243.33
76
77 $ snmptable -v 2c -c public -Cf + localhost at.atTable
78
79 SNMP table: at.atTable
80
81 atIfIndex+atPhysAddress+atNetAddress 1+8:0:20:20:0:ab+130.225.243.33
82
83 $ snmptable localhost -Cl -CB -Ci -OX -Cb -Cc 16 -Cw 64 ifTable
84
85 SNMP table: ifTable
86
87 Index Descr Type Mtu
88 Speed PhysAddress AdminStatus OperStatus
89 LastChange InOctets InUcastPkts InNUcastPkts
90 InDiscards InErrors InUnknownProtos OutOctets
91 OutUcastPkts OutNUcastPkts OutDiscards OutErrors
92 OutQLen Specific
93
94 index: [1]
95 1 lo softwareLoopbac 16436
96 10000000 up up
97 ? 2837283786 3052466 ?
98 0 0 ? 2837283786
99 3052466 ? 0 0
100 0 zeroDotZero
101
102 index: [2]
103 2 eth0 ethernetCsmacd 1500
104 10000000 0:5:5d:d1:f7:cf up up
105 ? 2052604234 44252973 ?
106 0 0 ? 149778187
107 65897282 ? 0 0
108 0 zeroDotZero
109
111 The test for TABLE-OID actually specifying a table is rather heuristic.
112 Note also that the test requires the defining MIB file to be loaded.
113
115 snmpcmd(1), variables(5).
116
117
118
119V5.9.1 25 Jul 2003 SNMPTABLE(1)