1SNMPNETSTAT(1)                     Net-SNMP                     SNMPNETSTAT(1)
2
3
4

NAME

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

SYNOPSIS

10       snmpnetstat [common options] [-Ca] [-Cn] AGENT
11       snmpnetstat [common options] [-Ci] [-Co] [-Cr] [-Cn] [-Cs] AGENT
12       snmpnetstat [common options] [-Ci] [-Cn] [-CI interface] AGENT  [inter‐
13       val]
14       snmpnetstat [common options] [-Ca] [-Cn] [-Cs] [-CP protocol] AGENT
15

DESCRIPTION

17       The  snmpnetstat  command  symbolically  displays the values of various
18       network-related information retrieved from a remote  system  using  the
19       SNMP  protocol.  There are a number of output formats, depending on the
20       options for the information presented.  The first form of  the  command
21       displays a list of active sockets.  The second form presents the values
22       of other network-related information according to the option  selected.
23       Using the third form, with an interval specified, snmpnetstat will con‐
24       tinuously display the information regarding packet traffic on the  con‐
25       figured  network interfaces.  The fourth form displays statistics about
26       the named protocol.
27
28       AGENT identifies a target SNMP agent, which is instrumented to  monitor
29       the  given objects.  At its simplest, the AGENT specification will con‐
30       sist of a hostname or an IPv4 address. In this situation,  the  command
31       will  attempt  communication with the agent, using UDP/IPv4 to port 161
32       of the given target host. See snmpcmd(1) for a full list of the  possi‐
33       ble formats for AGENT.
34

OPTIONS

36       The options have the following meaning:
37
38       common options
39        Please see snmpcmd(1) for a list of possible values for common options
40       as well as their descriptions.
41
42       -Ca With the default display, show the state of all  sockets;  normally
43       sockets used by server processes are not shown.
44
45       -Ci  Show  the  state of all of the network interfaces.  The  interface
46       display  provides  a  table  of cumulative statistics regarding packets
47       transferred,  errors,  and  collisions.   The  network addresses of the
48       interface and the maximum transmission unit  (``mtu'')  are  also  dis‐
49       played.
50
51       -Co  Show  an  abbreviated  interface status, giving octets in place of
52       packets.  This is useful when enquiring  virtual  interfaces  (such  as
53       Frame-Relay circuits) on a router.
54
55       -CI  interface Show information only about this interface; used with an
56       interval as described below.
57
58       -Cn Show network addresses as numbers (normally snmpnetstat  interprets
59       addresses  and attempts to display them symbolically).  This option may
60       be used with any of the display formats.
61
62       -CP protocol Show statistics about protocol, which is  either  a  well-
63       known  name for a protocol or an alias for it.  Some protocol names and
64       aliases are listed in the file /etc/protocols.  A null  response  typi‐
65       cally  means that there are no interesting numbers to report.  The pro‐
66       gram will complain if protocol is unknown or if there is no  statistics
67       routine for it.
68
69       -Cs  Show per-protocol statistics.  When used with the -Cr option, show
70       routing statistics instead.
71
72       -Cr Show the routing tables.  When -Cs is also present, show per-proto‐
73       col routing statistics instead of the routing tables.
74
75       When   snmpnetstat  is invoked with an interval argument, it displays a
76       running count of statistics related to  network  interfaces.   interval
77       is the number of seconds between reporting of statistics.
78
79       The Active Sockets Display (default)
80
81       The  default  display,  for  active sockets, shows the local and remote
82       addresses,  protocol,  and  the  internal  state   of  the    protocol.
83       Address    formats    are    of   the   form  ``host.port''  or  ``net‐
84       work.port'' if  a  socket's  address specifies  a  network  but no spe‐
85       cific  host  address.   When  known, the host and network addresses are
86       displayed symbolically according   to  the  data  bases /etc/hosts  and
87       /etc/networks,  respectively.  If a symbolic  name  for  an address  is
88       unknown, or if the -Cn option is  specified,  the  address  is  printed
89       numerically,  according  to  the  address family.  For more information
90       regarding the Internet ``dot format,'' refer   to  inet(3N).   Unspeci‐
91       fied,  or  ``wildcard'', addresses and ports appear as ``*''.
92
93       The Interface Display
94
95       The   interface   display  provides  a  table  of cumulative statistics
96       regarding packets transferred, errors, and col- lisions.   The  network
97       addresses  of the interface and the maximum transmission unit (``mtu'')
98       are also displayed.
99
100       The Routing Table Display
101
102       The routing table display indicates the  available  routes  and   their
103       status.    Each  route  consists of a destination host or network and a
104       gateway to use in  forwarding  pack- ets.   The flags field  shows  the
105       state  of  the  route  (``U''  if  ``up''), whether the route is  to  a
106       gateway  (``G''), whether  the  route  was created dynamically by a re‐
107       direct (``D''), and whether the route  has  been  modified  by  a redi‐
108       rect  (``M'').    Direct   routes   are   created  for  each  interface
109       attached  to  the  local  host;   the  gateway  field for  such entries
110       shows the address of the outgoing inter-  face.   The  interface  entry
111       indicates the network interface utilized for the route.
112
113       The Interface Display with an Interval
114
115       When  snmpnetstat  is  invoked with an interval argument, it displays a
116       running count of statistics  related  to   network  interfaces.    This
117       display   consists   of a column for the primary interface and a column
118       summarizing information for all  interfaces.   The  primary   interface
119       may  be replaced with another interface with the -CI option.  The first
120       line of each screen of information contains a summary since the  system
121       was  last rebooted.  Subsequent lines of output show values accumulated
122       over the preceding interval.
123
124       The Active Sockets Display for a Single Protocol
125
126       When a protocol is specified with the -CP option, the information  dis‐
127       played  is  similar  to that in the default display for active sockets,
128       except the display is limited to the given protocol.
129

EXAMPLES

131       Example of using snmpnetstat to display active sockets (default):
132
133       % snmpnetstat -v 2c -c public -Ca testhost
134
135       Active Internet (tcp) Connections (including servers)
136       Proto Local Address                Foreign Address                 (state)
137       tcp   *.echo                        *.*                            LISTEN
138       tcp   *.discard                     *.*                            LISTEN
139       tcp   *.daytime                     *.*                            LISTEN
140       tcp   *.chargen                     *.*                            LISTEN
141       tcp   *.ftp                         *.*                            LISTEN
142       tcp   *.telnet                      *.*                            LISTEN
143       tcp   *.smtp                        *.*                            LISTEN
144       ...
145
146       Active Internet (udp) Connections
147       Proto Local Address
148       udp    *.echo
149       udp    *.discard
150       udp    *.daytime
151       udp    *.chargen
152       udp    *.time
153       ...
154
155       % snmpnetstat -v 2c -c public -Ci testhost
156
157       Name     Mtu Network    Address          Ipkts   Ierrs    Opkts Oerrs Queue
158       eri0    1500 10.6.9/24  testhost     170548881  245601   687976     0    0
159       lo0     8232 127        localhost      7530982       0  7530982     0    0
160
161       Example of using snmpnetstat to show statistics about a specific proto‐
162       col:
163
164       % snmpnetstat -v 2c -c public -CP tcp testhost
165
166       Active Internet (tcp) Connections
167       Proto Local Address                Foreign Address                 (state)
168       tcp   *.echo                        *.*                            LISTEN
169       tcp   *.discard                     *.*                            LISTEN
170       tcp   *.daytime                     *.*                            LISTEN
171       tcp   *.chargen                     *.*                            LISTEN
172       tcp   *.ftp                         *.*                            LISTEN
173       tcp   *.telnet                      *.*                            LISTEN
174       tcp   *.smtp                        *.*                            LISTEN
175       ...
176

SEE ALSO

178       snmpcmd(1),  iostat(1), vmstat(1), hosts(5), networks(5), protocols(5),
179       services(5).
180

BUGS

182       The notion of errors is ill-defined.
183
184
185
1864.2 Berkeley Distribution         16 Nov 2006                   SNMPNETSTAT(1)
Impressum