1
.\" Portions of this file are subject to the following copyright. See
2
.\" the Net-SNMP's COPYING file for more details and other copyrights
4
.\" /***********************************************************
5
.\" Copyright 1989 by Carnegie Mellon University
7
.\" All Rights Reserved
9
.\" Permission to use, copy, modify, and distribute this software and its
10
.\" documentation for any purpose and without fee is hereby granted,
11
.\" provided that the above copyright notice appear in all copies and that
12
.\" both that copyright notice and this permission notice appear in
13
.\" supporting documentation, and that the name of CMU not be
14
.\" used in advertising or publicity pertaining to distribution of the
15
.\" software without specific, written prior permission.
17
.\" CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
18
.\" ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
19
.\" CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
20
.\" ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21
.\" WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
24
.\" ******************************************************************/
25
.\" Copyright (c) 1983 The Regents of the University of California.
26
.\" All rights reserved.
28
.\" Redistribution and use in source and binary forms are permitted
29
.\" provided that the above copyright notice and this paragraph are
30
.\" duplicated in all such forms and that any documentation,
31
.\" advertising materials, and other materials related to such
32
.\" distribution and use acknowledge that the software was developed
33
.\" by the University of California, Berkeley. The name of the
34
.\" University may not be used to endorse or promote products derived
35
.\" from this software without specific prior written permission.
36
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
37
.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
38
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
40
.\" @(#)netstat.1 6.8 (Berkeley) 9/20/88
42
.\" /***********************************************************
43
.\" Portions of this file are copyrighted by:
44
.\" Copyright Copyright 2003 Sun Microsystems, Inc. All rights reserved.
45
.\" Use is subject to license terms specified in the COPYING file
46
.\" distributed with the Net-SNMP package.
47
.\" ******************************************************************/
48
.TH SNMPNETSTAT 1 "25 Oct 2003" "" "Net-SNMP"
51
snmpnetstat \- show network status using SNMP
53
snmpnetstat [common options] [-a] [-n] AGENT
55
snmpnetstat [common options] [-iorns] AGENT
57
snmpnetstat [common options] [-in] [-I interface] AGENT [interval]
59
snmpnetstat [common options] [-an] [-s] [-P protocol] AGENT
63
command symbolically displays the values of various network-related
64
information retrieved from a remote system using the SNMP protocol.
65
There are a number of output formats,
66
depending on the options for the information presented.
67
The first form of the command displays a list of active sockets.
68
The second form presents the values of other network-related
69
information according to the option selected.
70
Using the third form, with an
74
will continuously display the information regarding packet
75
traffic on the configured network interfaces.
76
The fourth form displays statistics about the named protocol.
78
AGENT identifies a target SNMP agent, which is
79
instrumented to monitor the given objects.
80
At its simplest, the AGENT specification will
81
consist of a hostname or an IPv4 address. In this
82
situation, the command will attempt communication
83
with the agent, using UDP/IPv4 to port 161 of the
84
given target host. See snmpcmd(1) for a full list of
85
the possible formats for AGENT.
88
The options have the following meaning:
93
for a list of possible values for common options
94
as well as their descriptions.
97
With the default display,
98
show the state of all sockets; normally sockets used by
99
server processes are not shown.
102
Show the state of all of the network interfaces.
103
The interface display provides a table of cumulative
104
statistics regarding packets transferred, errors, and collisions.
105
The network addresses of the interface and the maximum transmission
106
unit (``mtu'') are also displayed.
109
Show an abbreviated interface status, giving octets in place of packets.
110
This is useful when enquiring virtual interfaces (such as Frame-Relay circuits)
114
Show information only about this interface;
120
Show network addresses as numbers (normally
122
interprets addresses and attempts to display them
124
This option may be used with any of the display formats.
127
Show statistics about
129
which is either a well-known name for a protocol or an alias for it. Some
130
protocol names and aliases are listed in the file
132
A null response typically means that there are no interesting numbers to
134
The program will complain if
136
is unknown or if there is no statistics routine for it.
139
Show per-protocol statistics. When used with the
141
option, show routing statistics instead.
144
Show the routing tables.
147
is also present, show per-protocol routing statistics instead of
150
When snmpnetstat is invoked with an interval argument, it
151
displays a running count of statistics related to network
154
is the number of seconds between
155
reporting of statistics.
157
.I The Active Sockets Display (default)
159
The default display, for active sockets, shows the local
160
and remote addresses, protocol, and the internal state of
161
the protocol. Address formats are of the form
162
``host.port'' or ``network.port'' if a socket's address
163
specifies a network but no specific host address. When
164
known, the host and network addresses are displayed symbolically
165
according to the data bases
168
respectively. If a symbolic name for an
169
address is unknown, or if the
171
option is specified, the
172
address is printed numerically, according to the address
173
family. For more information regarding the Internet ``dot
176
Unspecified, or ``wildcard'', addresses and ports appear as ``*''.
178
.I The Interface Display
180
The interface display provides a table of cumulative
181
statistics regarding packets transferred, errors, and col-
182
lisions. The network addresses of the interface and the
183
maximum transmission unit (``mtu'') are also displayed.
185
.I The Routing Table Display
187
The routing table display indicates the available routes
188
and their status. Each route consists of a destination
189
host or network and a gateway to use in forwarding pack-
190
ets. The flags field shows the state of the route (``U''
191
if ``up''), whether the route is to a gateway (``G''),
192
whether the route was created dynamically by a redirect
193
(``D''), and whether the route has been modified by a
194
redirect (``M''). Direct routes are created for each
195
interface attached to the local host; the gateway field
196
for such entries shows the address of the outgoing inter-
197
face. The interface entry indicates the network interface
198
utilized for the route.
200
.I The Interface Display with an Interval
207
displays a running count of statistics related to network
208
interfaces. This display consists of a column for the
209
primary interface and a column summarizing information for
210
all interfaces. The primary interface may be replaced
211
with another interface with the
213
option. The first line
214
of each screen of information contains a summary since the
215
system was last rebooted. Subsequent lines of output show
216
values accumulated over the preceding interval.
218
.I The Active Sockets Display for a
221
When a protocol is specified with the
224
information displayed is similar to that in the
225
default display for active sockets, except the
226
display is limited to the given protocol.
228
Example of using snmpnetstat to displaly active sockets (default):
230
% snmpnetstat -v 2c -c public -a testhost
233
Active Internet (tcp) Connections (including servers)
234
Proto Local Address Foreign Address (state)
235
tcp *.echo *.* LISTEN
236
tcp *.discard *.* LISTEN
237
tcp *.daytime *.* LISTEN
238
tcp *.chargen *.* LISTEN
240
tcp *.telnet *.* LISTEN
241
tcp *.smtp *.* LISTEN
244
Active Internet (udp) Connections
254
% snmpnetstat -v 2c -c public -i testhost
257
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue
258
eri0 1500 10.6.9/24 testhost 170548881 245601 687976 0 0
259
lo0 8232 127 localhost 7530982 0 7530982 0 0
262
Example of using snmpnetstat to show statistics about a specific protocol:
265
% snmpnetstat -v 2c -c public -P tcp testhost
267
Active Internet (tcp) Connections
268
Proto Local Address Foreign Address (state)
269
tcp *.echo *.* LISTEN
270
tcp *.discard *.* LISTEN
271
tcp *.daytime *.* LISTEN
272
tcp *.chargen *.* LISTEN
274
tcp *.telnet *.* LISTEN
275
tcp *.smtp *.* LISTEN
287
The notion of errors is ill-defined.