1SNMPNETSTAT(1) Net-SNMP SNMPNETSTAT(1)
2
3
4
6 snmpnetstat - display networking status and configuration information
7 from a network entity via SNMP
8
10 snmpnetstat [COMMON OPTIONS] [-Ca] [-Cn] [-Cv] [-Cf address_family]
11 AGENT
12 snmpnetstat [COMMON OPTIONS] [-Cr] [-Cn] [-Cv] [-Cf address_family]
13 AGENT
14 snmpnetstat [COMMON OPTIONS] [-Ci] [-C o | b | d] [-Cn] [-Cv] [-CI in‐
15 terface] [-Cw interval] AGENT
16 snmpnetstat [COMMON OPTIONS] [-Cs[s]] [-Cp protocol] AGENT
17
19 The snmpnetstat command symbolically displays the values of various
20 network-related information retrieved from a remote system using the
21 SNMP protocol. There are a number of output formats, depending on the
22 options for the information presented. The first form of the command
23 displays a list of active sockets. The second form presents the values
24 of other network-related information according to the option selected.
25 Using the third form, with an interval specified, snmpnetstat will con‐
26 tinuously display the information regarding packet traffic on the con‐
27 figured network interfaces. The fourth form displays statistics about
28 the named protocol.
29
30 snmpnetstat will issue GETBULK requests to query for information if at
31 least protocol version v2 is used.
32
33 AGENT identifies a target SNMP agent, which is instrumented to monitor
34 the given objects. At its simplest, the AGENT specification will con‐
35 sist of a hostname or an IPv4 address. In this situation, the command
36 will attempt communication with the agent, using UDP/IPv4 to port 161
37 of the given target host. See snmpcmd(1) for a full list of the possi‐
38 ble formats for AGENT.
39
41 The options have the following meaning:
42
43 COMMON OPTIONS
44 Please see snmpcmd(1) for a list of possible values for common options
45 as well as their descriptions.
46
47 -CL use the legacy SNMP MIB elements, not the modern IP version agnos‐
48 tic tables. snmpnetstat will automatically fall back to the legacy ta‐
49 bles if the modern ones are not available.
50
51 -Ca With the default display, show the state of all sockets; normally
52 sockets used by server processes are not shown.
53
54 -Cf address_family Only show entries for the selected address family
55 (inet, inet6)
56
57 -Ci Show the state of all of the network interfaces. The interface
58 display provides a table of cumulative statistics regarding packets
59 transferred, errors, and collisions. The network addresses of the in‐
60 terface and the maximum transmission unit (``mtu'') are also displayed.
61
62 -Cd Add dropped packets to the interface display.
63
64 -Cb Show an extended interface status, giving octets in addition to
65 packets.
66
67 -Co Show an abbreviated interface status, giving octets in place of
68 packets. This is useful when enquiring virtual interfaces (such as
69 Frame-Relay circuits) on a router.
70
71 -CI interface Show information only about this interface; used with an
72 interval as described below.
73
74 -Cn Show network addresses as numbers (normally snmpnetstat interprets
75 addresses and attempts to display them symbolically). This option may
76 be used with any of the display formats.
77
78 -Cv Allow long host or service names to break the columnar output.
79 This option may be used with any of the display formats.
80
81 -Cp protocol Show statistics about protocol, which is either a well-
82 known name for a protocol or an alias for it. Some protocol names and
83 aliases are listed in the file /etc/protocols. A null response typi‐
84 cally means that there are no interesting numbers to report. The pro‐
85 gram will complain if protocol is unknown or if there is no statistics
86 routine for it.
87
88 -Cs Show per-protocol statistics. If this is duplicated (-Css) statis‐
89 tics entries which are zero will be suppressed.
90
91 -Cr Show the routing tables.
92
93 -CR repeaters For GETBULK requests, repeaters specifies the max-re‐
94 peaters value to use.
95
96 When snmpnetstat is invoked with an interval argument, it displays a
97 running count of statistics related to network interfaces. interval is
98 the number of seconds between reporting of statistics.
99
100 The Active Sockets Display (default)
101
102 The default display, for active sockets, shows the local and remote ad‐
103 dresses, protocol, and the internal state of the protocol. Address
104 formats are of the form ``host.port'' or ``network.port'' if a socket's
105 address specifies a network but no specific host address. When known,
106 the host and network addresses are displayed symbolically according to
107 the databases /etc/hosts and /etc/networks, respectively. If a sym‐
108 bolic name for an address is unknown, or if the -Cn option is speci‐
109 fied, the address is printed numerically, according to the address fam‐
110 ily. For more information regarding the Internet ``dot format,'' refer
111 to inet(3N). Unspecified, or ``wildcard'', addresses and ports appear
112 as ``*''.
113
114 The Interface Display
115
116 The interface display provides a table of cumulative statistics regard‐
117 ing packets transferred, errors, and col- lisions. The network ad‐
118 dresses of the interface and the maximum transmission unit (``mtu'')
119 are also displayed.
120
121 The Routing Table Display
122
123 The routing table display indicates the available routes and their sta‐
124 tus. Each route consists of a destination host or network and a gate‐
125 way to use in forwarding pack- ets. The flags field shows the state of
126 the route (``U'' if ``up''), whether the route is to a gateway (``G''),
127 whether the route was created dynamically by a redirect (``D''), and
128 whether the route has been modified by a redirect (``M''). Direct
129 routes are created for each interface attached to the local host; the
130 gateway field for such entries shows the address of the outgoing inter-
131 face. The interface entry indicates the network interface utilized for
132 the route.
133
134 The Interface Display with an Interval
135
136 When snmpnetstat is invoked with an interval argument, it displays a
137 running count of statistics related to network interfaces. This dis‐
138 play consists of a column for the primary interface and a column summa‐
139 rizing information for all interfaces. The primary interface may be
140 replaced with another interface with the -CI option. The first line of
141 each screen of information contains a summary since the system was last
142 rebooted. Subsequent lines of output show values accumulated over the
143 preceding interval.
144
145 The Active Sockets Display for a Single Protocol
146
147 When a protocol is specified with the -Cp option, the information dis‐
148 played is similar to that in the default display for active sockets,
149 except the display is limited to the given protocol.
150
152 Example of using snmpnetstat to display active sockets (default):
153
154 % snmpnetstat -v 2c -c public -Ca testhost
155
156 Active Internet (tcp) Connections (including servers)
157 Proto Local Address Foreign Address (state)
158 tcp *.echo *.* LISTEN
159 tcp *.discard *.* LISTEN
160 tcp *.daytime *.* LISTEN
161 tcp *.chargen *.* LISTEN
162 tcp *.ftp *.* LISTEN
163 tcp *.telnet *.* LISTEN
164 tcp *.smtp *.* LISTEN
165 ...
166
167 Active Internet (udp) Connections
168 Proto Local Address
169 udp *.echo
170 udp *.discard
171 udp *.daytime
172 udp *.chargen
173 udp *.time
174 ...
175
176 % snmpnetstat -v 2c -c public -Ci testhost
177
178 Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue
179 eri0 1500 10.6.9/24 testhost 170548881 245601 687976 0 0
180 lo0 8232 127 localhost 7530982 0 7530982 0 0
181
182 Example of using snmpnetstat to show statistics about a specific proto‐
183 col:
184
185 % snmpnetstat -v 2c -c public -Cp tcp testhost
186
187 Active Internet (tcp) Connections
188 Proto Local Address Foreign Address (state)
189 tcp *.echo *.* LISTEN
190 tcp *.discard *.* LISTEN
191 tcp *.daytime *.* LISTEN
192 tcp *.chargen *.* LISTEN
193 tcp *.ftp *.* LISTEN
194 tcp *.telnet *.* LISTEN
195 tcp *.smtp *.* LISTEN
196 ...
197
199 snmpcmd(1), iostat(1), vmstat(1), hosts(5), networks(5), protocols(5),
200 services(5).
201
203 The notion of errors is ill-defined.
204
205
206
207V5.9.3 04 Nov 2013 SNMPNETSTAT(1)