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       snmpnetstat will issue GETBULK requests to query for information if  at
29       least protocol version v2 is used.
30
31       AGENT  identifies a target SNMP agent, which is instrumented to monitor
32       the given objects.  At its simplest, the AGENT specification will  con‐
33       sist  of  a hostname or an IPv4 address. In this situation, the command
34       will attempt communication with the agent, using UDP/IPv4 to  port  161
35       of  the given target host. See snmpcmd(1) for a full list of the possi‐
36       ble formats for AGENT.
37

OPTIONS

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

EXAMPLES

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

SEE ALSO

184       snmpcmd(1),  iostat(1), vmstat(1), hosts(5), networks(5), protocols(5),
185       services(5).
186

BUGS

188       The notion of errors is ill-defined.
189
190
191
1924.2 Berkeley Distribution         16 Nov 2006                   SNMPNETSTAT(1)
Impressum