1SNMPNETSTAT(1)                     Net-SNMP                     SNMPNETSTAT(1)


6       snmpnetstat  -  display networking status and configuration information
7       from a network entity via SNMP


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
15       interface] [-Cw interval] AGENT
16       snmpnetstat [COMMON OPTIONS] [-Cs[s]] [-Cp protocol] AGENT


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.
30       snmpnetstat will issue GETBULK requests to query for information if  at
31       least protocol version v2 is used.
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.


41       The options have the following meaning:
44        Please see snmpcmd(1) for a list of possible values for common options
45       as well as their descriptions.
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
49       tables if the modern ones are not available.
51       -Ca  With  the default display, show the state of all sockets; normally
52       sockets used by server processes are not shown.
54       -Cf address_family Only show entries for the  selected  address  family
55       (inet, inet6)
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
60       interface and the maximum transmission unit  (``mtu'')  are  also  dis‐
61       played.
63       -Cd Add dropped packets to the interface display.
65       -Cb  Show  an  extended  interface status, giving octets in addition to
66       packets.
68       -Co Show an abbreviated interface status, giving  octets  in  place  of
69       packets.   This  is  useful  when enquiring virtual interfaces (such as
70       Frame-Relay circuits) on a router.
72       -CI interface Show information only about this interface; used with  an
73       interval as described below.
75       -Cn  Show network addresses as numbers (normally snmpnetstat interprets
76       addresses and attempts to display them symbolically).  This option  may
77       be used with any of the display formats.
79       -Cv  Allow  long  host  or  service names to break the columnar output.
80       This option may be used with any of the display formats.
82       -Cp protocol Show statistics about protocol, which is  either  a  well-
83       known  name for a protocol or an alias for it.  Some protocol names and
84       aliases are listed in the file /etc/protocols.  A null  response  typi‐
85       cally  means that there are no interesting numbers to report.  The pro‐
86       gram will complain if protocol is unknown or if there is no  statistics
87       routine for it.
89       -Cs Show per-protocol statistics.  If this is duplicated (-Css) statis‐
90       tics entries which are zero will be suppressed.
92       -Cr Show the routing tables.
94       -CR repeaters  For  GETBULK  requests,  repeaters  specifies  the  max-
95       repeaters value to use.
97       When  snmpnetstat  is  invoked with an interval argument, it displays a
98       running count of statistics related to network interfaces.  interval is
99       the number of seconds between reporting of statistics.
101       The Active Sockets Display (default)
103       The  default  display,  for  active sockets, shows the local and remote
104       addresses, protocol, and the internal state of the  protocol.   Address
105       formats are of the form ``host.port'' or ``network.port'' if a socket's
106       address specifies a network but no specific host address.  When  known,
107       the  host and network addresses are displayed symbolically according to
108       the databases /etc/hosts and /etc/networks, respectively.   If  a  sym‐
109       bolic  name  for  an address is unknown, or if the -Cn option is speci‐
110       fied, the address is printed numerically, according to the address fam‐
111       ily.  For more information regarding the Internet ``dot format,'' refer
112       to inet(3N).  Unspecified, or ``wildcard'', addresses and ports  appear
113       as ``*''.
115       The Interface Display
117       The interface display provides a table of cumulative statistics regard‐
118       ing  packets  transferred,  errors,  and  col-  lisions.   The  network
119       addresses  of the interface and the maximum transmission unit (``mtu'')
120       are also displayed.
122       The Routing Table Display
124       The routing table display indicates the available routes and their sta‐
125       tus.   Each route consists of a destination host or network and a gate‐
126       way to use in forwarding pack- ets.  The flags field shows the state of
127       the route (``U'' if ``up''), whether the route is to a gateway (``G''),
128       whether the route was created dynamically by a  redirect  (``D''),  and
129       whether  the  route  has  been  modified by a redirect (``M'').  Direct
130       routes are created for each interface attached to the local  host;  the
131       gateway field for such entries shows the address of the outgoing inter-
132       face.  The interface entry indicates the network interface utilized for
133       the route.
135       The Interface Display with an Interval
137       When  snmpnetstat  is  invoked with an interval argument, it displays a
138       running count of statistics related to network interfaces.   This  dis‐
139       play consists of a column for the primary interface and a column summa‐
140       rizing information for all interfaces.  The primary  interface  may  be
141       replaced with another interface with the -CI option.  The first line of
142       each screen of information contains a summary since the system was last
143       rebooted.   Subsequent lines of output show values accumulated over the
144       preceding interval.
146       The Active Sockets Display for a Single Protocol
148       When a protocol is specified with the -Cp option, the information  dis‐
149       played  is  similar  to that in the default display for active sockets,
150       except the display is limited to the given protocol.


153       Example of using snmpnetstat to display active sockets (default):
155       % snmpnetstat -v 2c -c public -Ca testhost
157       Active Internet (tcp) Connections (including servers)
158       Proto Local Address                Foreign Address                 (state)
159       tcp   *.echo                        *.*                            LISTEN
160       tcp   *.discard                     *.*                            LISTEN
161       tcp   *.daytime                     *.*                            LISTEN
162       tcp   *.chargen                     *.*                            LISTEN
163       tcp   *.ftp                         *.*                            LISTEN
164       tcp   *.telnet                      *.*                            LISTEN
165       tcp   *.smtp                        *.*                            LISTEN
166       ...
168       Active Internet (udp) Connections
169       Proto Local Address
170       udp    *.echo
171       udp    *.discard
172       udp    *.daytime
173       udp    *.chargen
174       udp    *.time
175       ...
177       % snmpnetstat -v 2c -c public -Ci testhost
179       Name     Mtu Network    Address          Ipkts   Ierrs    Opkts Oerrs Queue
180       eri0    1500 10.6.9/24  testhost     170548881  245601   687976     0    0
181       lo0     8232 127        localhost      7530982       0  7530982     0    0
183       Example of using snmpnetstat to show statistics about a specific proto‐
184       col:
186       % snmpnetstat -v 2c -c public -Cp tcp testhost
188       Active Internet (tcp) Connections
189       Proto Local Address                Foreign Address                 (state)
190       tcp   *.echo                        *.*                            LISTEN
191       tcp   *.discard                     *.*                            LISTEN
192       tcp   *.daytime                     *.*                            LISTEN
193       tcp   *.chargen                     *.*                            LISTEN
194       tcp   *.ftp                         *.*                            LISTEN
195       tcp   *.telnet                      *.*                            LISTEN
196       tcp   *.smtp                        *.*                            LISTEN
197       ...


200       snmpcmd(1),  iostat(1), vmstat(1), hosts(5), networks(5), protocols(5),
201       services(5).


204       The notion of errors is ill-defined.
208V5.8                              04 Nov 2013                   SNMPNETSTAT(1)