blob: 8e1450ab84ae3e9a295daffe7a120a5daeb241e1 [file] [log] [blame]
Wes Hardakera8bd6492003-09-06 05:06:03 +00001.\" Portions of this file are subject to the following copyright. See
2.\" the Net-SNMP's COPYING file for more details and other copyrights
3.\" that may apply:
Niels Baggesenbbc86272000-06-27 07:31:01 +00004.\" /***********************************************************
Wes Hardakerfca311a1995-03-09 00:08:14 +00005.\" Copyright 1989 by Carnegie Mellon University
6.\"
7.\" All Rights Reserved
8.\"
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.
16.\"
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
23.\" SOFTWARE.
24.\" ******************************************************************/
Wes Hardakerfca311a1995-03-09 00:08:14 +000025.\"
Dave Shielda113ee72005-10-27 09:38:40 +000026.\" Copyright (c) 1983, 1988, 1993
27.\" The Regents of the University of California. All rights reserved.
28.\"
29.\" Redistribution and use in source and binary forms, with or without
30.\" modification, are permitted provided that the following conditions
31.\" are met:
32.\" 1. Redistributions of source code must retain the above copyright
33.\" notice, this list of conditions and the following disclaimer.
34.\" 2. Redistributions in binary form must reproduce the above copyright
35.\" notice, this list of conditions and the following disclaimer in the
36.\" documentation and/or other materials provided with the distribution.
37.\" 3. Neither the name of the University nor the names of its contributors
38.\" may be used to endorse or promote products derived from this software
39.\" without specific prior written permission.
40.\"
41.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
42.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
45.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51.\" SUCH DAMAGE.
Wes Hardakerfca311a1995-03-09 00:08:14 +000052.\"
53.\" @(#)netstat.1 6.8 (Berkeley) 9/20/88
54.\"
Wes Hardakera8bd6492003-09-06 05:06:03 +000055.\" /***********************************************************
56.\" Portions of this file are copyrighted by:
57.\" Copyright Copyright 2003 Sun Microsystems, Inc. All rights reserved.
58.\" Use is subject to license terms specified in the COPYING file
59.\" distributed with the Net-SNMP package.
60.\" ******************************************************************/
Dave Shield5c16e912010-11-01 13:42:54 +000061.TH SNMPNETSTAT 1 "20 Jan 2010" VVERSIONINFO "Net-SNMP"
Wes Hardakerfca311a1995-03-09 00:08:14 +000062.SH NAME
Dave Shield0f2d1f32004-11-05 09:28:57 +000063snmpnetstat \- display networking status and configuration information from a network entity via SNMP
Wes Hardakerfca311a1995-03-09 00:08:14 +000064.SH SYNOPSIS
Alex Burger622e71b2004-09-27 21:21:47 +000065.B snmpnetstat
Dave Shield19e27152012-02-28 14:05:34 +000066[COMMON OPTIONS] [-Ca] [-Cn] AGENT
Wes Hardakerfca311a1995-03-09 00:08:14 +000067.br
Alex Burger622e71b2004-09-27 21:21:47 +000068.B snmpnetstat
Dave Shield19e27152012-02-28 14:05:34 +000069[COMMON OPTIONS] [-Ci] [-Co] [-Cr] [-Cn] [-Cs] AGENT
Wes Hardakerfca311a1995-03-09 00:08:14 +000070.br
Alex Burger622e71b2004-09-27 21:21:47 +000071.B snmpnetstat
Dave Shield19e27152012-02-28 14:05:34 +000072[COMMON OPTIONS] [-Ci] [-Cn] [-CI interface] AGENT [interval]
Wes Hardakerfca311a1995-03-09 00:08:14 +000073.br
Alex Burger622e71b2004-09-27 21:21:47 +000074.B snmpnetstat
Dave Shield19e27152012-02-28 14:05:34 +000075[COMMON OPTIONS] [-Ca] [-Cn] [-Cs] [-Cp protocol] AGENT
Wes Hardakerfca311a1995-03-09 00:08:14 +000076.SH DESCRIPTION
77The
Alex Burger622e71b2004-09-27 21:21:47 +000078.B snmpnetstat
Wes Hardakerfca311a1995-03-09 00:08:14 +000079command symbolically displays the values of various network-related
80information retrieved from a remote system using the SNMP protocol.
81There are a number of output formats,
82depending on the options for the information presented.
83The first form of the command displays a list of active sockets.
84The second form presents the values of other network-related
85information according to the option selected.
86Using the third form, with an
87.I interval
88specified,
89.I snmpnetstat
90will continuously display the information regarding packet
91traffic on the configured network interfaces.
92The fourth form displays statistics about the named protocol.
93.PP
Wes Hardakera8bd6492003-09-06 05:06:03 +000094AGENT identifies a target SNMP agent, which is
95instrumented to monitor the given objects.
96At its simplest, the AGENT specification will
97consist of a hostname or an IPv4 address. In this
98situation, the command will attempt communication
99with the agent, using UDP/IPv4 to port 161 of the
100given target host. See snmpcmd(1) for a full list of
101the possible formats for AGENT.
Wes Hardakerfca311a1995-03-09 00:08:14 +0000102.PP
Wes Hardakera8bd6492003-09-06 05:06:03 +0000103.SH OPTIONS
Wes Hardakerfca311a1995-03-09 00:08:14 +0000104The options have the following meaning:
Wes Hardakera8bd6492003-09-06 05:06:03 +0000105.PP
Dave Shield19e27152012-02-28 14:05:34 +0000106.B COMMON OPTIONS
Wes Hardakera8bd6492003-09-06 05:06:03 +0000107 Please see
108.I snmpcmd(1)
109for a list of possible values for common options
110as well as their descriptions.
111.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000112.B \-Ca
Wes Hardakerfca311a1995-03-09 00:08:14 +0000113With the default display,
114show the state of all sockets; normally sockets used by
115server processes are not shown.
Wes Hardakera8bd6492003-09-06 05:06:03 +0000116.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000117.B \-Ci
Wes Hardakera8bd6492003-09-06 05:06:03 +0000118Show the state of all of the network interfaces.
119The interface display provides a table of cumulative
120statistics regarding packets transferred, errors, and collisions.
121The network addresses of the interface and the maximum transmission
122unit (``mtu'') are also displayed.
123.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000124.B \-Co
Wes Hardaker9fde6051997-03-13 16:47:32 +0000125Show an abbreviated interface status, giving octets in place of packets.
126This is useful when enquiring virtual interfaces (such as Frame-Relay circuits)
Wes Hardakera8bd6492003-09-06 05:06:03 +0000127on a router.
128.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000129.BI \-CI " interface"
Wes Hardakerfca311a1995-03-09 00:08:14 +0000130Show information only about this interface;
131used with an
132.I interval
133as described below.
Wes Hardakera8bd6492003-09-06 05:06:03 +0000134.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000135.B \-Cn
Wes Hardakerfca311a1995-03-09 00:08:14 +0000136Show network addresses as numbers (normally
137.I snmpnetstat
138interprets addresses and attempts to display them
139symbolically).
140This option may be used with any of the display formats.
Wes Hardakera8bd6492003-09-06 05:06:03 +0000141.PP
Jan Safranek38a8b5e2010-01-20 08:53:02 +0000142.BI \-Cp " protocol"
Wes Hardakerfca311a1995-03-09 00:08:14 +0000143Show statistics about
Wes Hardakera8bd6492003-09-06 05:06:03 +0000144.IR protocol,
Wes Hardakerfca311a1995-03-09 00:08:14 +0000145which is either a well-known name for a protocol or an alias for it. Some
146protocol names and aliases are listed in the file
147.IR /etc/protocols .
148A null response typically means that there are no interesting numbers to
149report.
150The program will complain if
151.I protocol
152is unknown or if there is no statistics routine for it.
Wes Hardakera8bd6492003-09-06 05:06:03 +0000153.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000154.B \-Cs
Wes Hardakera8bd6492003-09-06 05:06:03 +0000155Show per-protocol statistics. When used with the
Thomas Anders19b11052006-11-15 23:36:36 +0000156.B \-Cr
Wes Hardakera8bd6492003-09-06 05:06:03 +0000157option, show routing statistics instead.
158.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000159.B \-Cr
Wes Hardakerfca311a1995-03-09 00:08:14 +0000160Show the routing tables.
161When
Thomas Anders19b11052006-11-15 23:36:36 +0000162.B \-Cs
Wes Hardakera8bd6492003-09-06 05:06:03 +0000163is also present, show per-protocol routing statistics instead of
164the routing tables.
165.PP
Wes Hardakera8bd6492003-09-06 05:06:03 +0000166When snmpnetstat is invoked with an interval argument, it
167displays a running count of statistics related to network
Dave Shield490da092003-12-18 09:58:14 +0000168interfaces.
169.I interval
170is the number of seconds between
Wes Hardakera8bd6492003-09-06 05:06:03 +0000171reporting of statistics.
172.PP
173.I The Active Sockets Display (default)
Wes Hardakerfca311a1995-03-09 00:08:14 +0000174.PP
175The default display, for active sockets, shows the local
Wes Hardakera8bd6492003-09-06 05:06:03 +0000176and remote addresses, protocol, and the internal state of
177the protocol. Address formats are of the form
178``host.port'' or ``network.port'' if a socket's address
179specifies a network but no specific host address. When
180known, the host and network addresses are displayed symbolically
181according to the data bases
182.I /etc/hosts and
183.IR /etc/networks,
184respectively. If a symbolic name for an
185address is unknown, or if the
Thomas Anders19b11052006-11-15 23:36:36 +0000186.B \-Cn
Dave Shield490da092003-12-18 09:58:14 +0000187option is specified, the
Wes Hardakera8bd6492003-09-06 05:06:03 +0000188address is printed numerically, according to the address
189family. For more information regarding the Internet ``dot
190format,'' refer to
191.IR inet(3N).
192Unspecified, or ``wildcard'', addresses and ports appear as ``*''.
Wes Hardakerfca311a1995-03-09 00:08:14 +0000193.PP
Wes Hardakera8bd6492003-09-06 05:06:03 +0000194.I The Interface Display
Wes Hardakerfca311a1995-03-09 00:08:14 +0000195.PP
Wes Hardakera8bd6492003-09-06 05:06:03 +0000196The interface display provides a table of cumulative
197statistics regarding packets transferred, errors, and col-
198lisions. The network addresses of the interface and the
199maximum transmission unit (``mtu'') are also displayed.
Wes Hardakerfca311a1995-03-09 00:08:14 +0000200.PP
Wes Hardakera8bd6492003-09-06 05:06:03 +0000201.I The Routing Table Display
202.PP
203The routing table display indicates the available routes
204and their status. Each route consists of a destination
205host or network and a gateway to use in forwarding pack-
206ets. The flags field shows the state of the route (``U''
207if ``up''), whether the route is to a gateway (``G''),
208whether the route was created dynamically by a redirect
209(``D''), and whether the route has been modified by a
210redirect (``M''). Direct routes are created for each
211interface attached to the local host; the gateway field
212for such entries shows the address of the outgoing inter-
213face. The interface entry indicates the network interface
214utilized for the route.
215.PP
216.I The Interface Display with an Interval
217.PP
218When
Wes Hardakerfca311a1995-03-09 00:08:14 +0000219.I snmpnetstat
220is invoked with an
221.I interval
Wes Hardakera8bd6492003-09-06 05:06:03 +0000222argument, it
223displays a running count of statistics related to network
224interfaces. This display consists of a column for the
225primary interface and a column summarizing information for
226all interfaces. The primary interface may be replaced
227with another interface with the
Thomas Anders19b11052006-11-15 23:36:36 +0000228.B \-CI
Wes Hardakera8bd6492003-09-06 05:06:03 +0000229option. The first line
230of each screen of information contains a summary since the
231system was last rebooted. Subsequent lines of output show
232values accumulated over the preceding interval.
233.PP
234.I The Active Sockets Display for a
235.I Single Protocol
236.PP
237When a protocol is specified with the
Jan Safranek38a8b5e2010-01-20 08:53:02 +0000238.B \-Cp
Wes Hardakera8bd6492003-09-06 05:06:03 +0000239option, the
240information displayed is similar to that in the
241default display for active sockets, except the
242display is limited to the given protocol.
243.SH EXAMPLES
Thomas Anders19b11052006-11-15 23:36:36 +0000244Example of using snmpnetstat to display active sockets (default):
Wes Hardakera8bd6492003-09-06 05:06:03 +0000245.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000246% snmpnetstat -v 2c -c public -Ca testhost
Wes Hardakera8bd6492003-09-06 05:06:03 +0000247.PP
248.nf
249Active Internet (tcp) Connections (including servers)
250Proto Local Address Foreign Address (state)
251tcp *.echo *.* LISTEN
252tcp *.discard *.* LISTEN
253tcp *.daytime *.* LISTEN
254tcp *.chargen *.* LISTEN
255tcp *.ftp *.* LISTEN
256tcp *.telnet *.* LISTEN
257tcp *.smtp *.* LISTEN
Thomas Andersa43ed6e2006-01-31 18:32:22 +0000258\&...
Wes Hardakera8bd6492003-09-06 05:06:03 +0000259
260Active Internet (udp) Connections
261Proto Local Address
262udp *.echo
263udp *.discard
264udp *.daytime
265udp *.chargen
266udp *.time
Thomas Andersa43ed6e2006-01-31 18:32:22 +0000267\&...
Wes Hardakera8bd6492003-09-06 05:06:03 +0000268.fi
269.PP
Thomas Anders19b11052006-11-15 23:36:36 +0000270% snmpnetstat -v 2c -c public -Ci testhost
Wes Hardakera8bd6492003-09-06 05:06:03 +0000271.PP
272.nf
273Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue
274eri0 1500 10.6.9/24 testhost 170548881 245601 687976 0 0
275lo0 8232 127 localhost 7530982 0 7530982 0 0
276.fi
277.PP
278Example of using snmpnetstat to show statistics about a specific protocol:
279.PP
280.nf
Jan Safranek38a8b5e2010-01-20 08:53:02 +0000281% snmpnetstat -v 2c -c public -Cp tcp testhost
Wes Hardakera8bd6492003-09-06 05:06:03 +0000282
283Active Internet (tcp) Connections
284Proto Local Address Foreign Address (state)
285tcp *.echo *.* LISTEN
286tcp *.discard *.* LISTEN
287tcp *.daytime *.* LISTEN
288tcp *.chargen *.* LISTEN
289tcp *.ftp *.* LISTEN
290tcp *.telnet *.* LISTEN
291tcp *.smtp *.* LISTEN
Thomas Andersa43ed6e2006-01-31 18:32:22 +0000292\&...
Wes Hardakera8bd6492003-09-06 05:06:03 +0000293.fi
Wes Hardakerfca311a1995-03-09 00:08:14 +0000294.SH SEE ALSO
Niels Baggesen0493cdd2000-09-04 22:12:35 +0000295snmpcmd(1),
Wes Hardakerfca311a1995-03-09 00:08:14 +0000296iostat(1),
297vmstat(1),
298hosts(5),
299networks(5),
300protocols(5),
Niels Baggesen0493cdd2000-09-04 22:12:35 +0000301services(5).
Wes Hardakerfca311a1995-03-09 00:08:14 +0000302.SH BUGS
303The notion of errors is ill-defined.