SNMPNETSTAT(1)
π SNMPNETSTAT(1) π
okay bestie, welcome to snmpnetstat, part of the Net-SNMP situation β this is the girl that shows you networking status and configuration info from a whole entire remote network entity, and she does it over SNMP. no cap. π¦
β¨ NAME β¨
snmpnetstat β display networking status and configuration information from a network entity via SNMP
πΈ SYNOPSIS πΈ
snmpnetstat [COMMON OPTIONS] [-Ca] [-Cn] [-Cv] [-Cf address_family]
AGENT
snmpnetstat [COMMON OPTIONS] [-Cr] [-Cn] [-Cv] [-Cf address_family]
AGENT
snmpnetstat [COMMON OPTIONS] [-Ci] [-C o | b | d] [-Cn] [-Cv] [-CI
interface] [-Cw interval] AGENT
snmpnetstat [COMMON OPTIONS] [-Cs[s]] [-Cp protocol] AGENT
π DESCRIPTION π
so like, the snmpnetstat command symbolically displays the values of various network-related information that it retrieved from a remote system using the SNMP protocol. π
there are a bunch of output formats, and which one you get depends on the options you picked for the information being presented, iykyk:
- the first form of the command displays a list of active sockets.
- the second form presents the values of other network-related information according to the option selected.
- using the third form, with an interval specified,
snmpnetstatwill continuously display the information regarding packet traffic on the configured network interfaces. - the fourth form displays statistics about the named protocol.
snmpnetstat will issue GETBULK requests to query for information if at least protocol version v2 is used. β
AGENT identifies a target SNMP agent, which is instrumented to monitor the given objects. at its simplest, the AGENT specification will consist of a hostname or an IPv4 address. in this situation, the command will attempt communication with the agent, using UDP/IPv4 to port 161 of the given target host. see snmpcmd(1) for a full list of the possible formats for AGENT. π«Ά
π OPTIONS π
the options have the following meaning:
π COMMON OPTIONS π
please see snmpcmd(1) for a list of possible values for common options as well as their descriptions. (yes, go read it, it's giving necessary.)
-CLβ use the legacy SNMP MIB elements, not the modern IP version agnostic tables.snmpnetstatwill automatically fall back to the legacy tables if the modern ones are not available. (she's got a backup plan, periodt.)-Caβ with the default display, show the state of all sockets; normally sockets used by server processes are not shown. π-Cf address_familyβ only show entries for the selected address family (inet,inet6)-Ciβ show the state of all of the network interfaces. the interface display provides a table of cumulative statistics regarding packets transferred, errors, and collisions. the network addresses of the interface and the maximum transmission unit (``mtu'') are also displayed. β¨-Cdβ add dropped packets to the interface display.-Cbβ show an extended interface status, giving octets in addition to packets.-Coβ show an abbreviated interface status, giving octets in place of packets. this is useful when enquiring virtual interfaces (such as Frame-Relay circuits) on a router. π§-CI interfaceβ show information only about this interface; used with an interval as described below.-Cnβ show network addresses as numbers (normallysnmpnetstatinterprets addresses and attempts to display them symbolically). this option may be used with any of the display formats. π’-Cvβ allow long host or service names to break the columnar output. this option may be used with any of the display formats.-Cp protocolβ show statistics aboutprotocol, which is either a well-known name for a protocol or an alias for it. some protocol names and aliases are listed in the file/etc/protocols. a null response typically means that there are no interesting numbers to report. the program will complain ifprotocolis unknown or if there is no statistics routine for it. π-Csβ show per-protocol statistics. if this is duplicated (-Css) statistics entries which are zero will be suppressed. (double it and the zeros vanish, iconic.)-Crβ show the routing tables.-CR repeatersβ forGETBULKrequests,repeatersspecifies the max-repeaters value to use.
when snmpnetstat is invoked with an interval argument, it displays a running count of statistics related to network interfaces. interval is the number of seconds between reporting of statistics. β±οΈ
π The Active Sockets Display (default) π
the default display, for active sockets, shows the local and remote addresses, protocol, and the internal state of the protocol. address formats are of the form host.port'' or network.port'' if a socket's address specifies a network but no specific host address. when known, the host and network addresses are displayed symbolically according to the databases /etc/hosts and /etc/networks, respectively. if a symbolic name for an address is unknown, or if the -Cn option is specified, the address is printed numerically, according to the address family. for more information regarding the Internet dot format,'' refer to `inet(3N)`. unspecified, or wildcard'', addresses and ports appear as ``*''. π
π The Interface Display π
the interface display provides a table of cumulative statistics regarding packets transferred, errors, and col- lisions. the network addresses of the interface and the maximum transmission unit (mtu'') are also displayed. (yes the original says col- lisions'' with the line break in the middle, we don't question the ancestors.)
π¦ The Routing Table Display π¦
the routing table display indicates the available routes and their status. each route consists of a destination host or network and a gateway to use in forwarding pack- ets. the flags field shows the state of the route (U'' if up''), whether the route is to a gateway (G''), whether the route was created dynamically by a redirect (D''), and whether the route has been modified by a redirect (``M''). direct routes are created for each interface attached to the local host; the gateway field for such entries shows the address of the outgoing inter- face. the interface entry indicates the network interface utilized for the route. πΊοΈ
β The Interface Display with an Interval β
when snmpnetstat is invoked with an interval argument, it displays a running count of statistics related to network interfaces. this display consists of a column for the primary interface and a column summarizing information for all interfaces. the primary interface may be replaced with another interface with the -CI option. the first line of each screen of information contains a summary since the system was last rebooted. subsequent lines of output show values accumulated over the preceding interval. π
π The Active Sockets Display for a Single Protocol π
when a protocol is specified with the -Cp option, the information displayed is similar to that in the default display for active sockets, except the display is limited to the given protocol.
π₯ EXAMPLES π₯
example of using snmpnetstat to display active sockets (default):
% snmpnetstat -v 2c -c public -Ca testhost
Active Internet (tcp) Connections (including servers)
Proto Local Address Foreign Address (state)
tcp *.echo *.* LISTEN
tcp *.discard *.* LISTEN
tcp *.daytime *.* LISTEN
tcp *.chargen *.* LISTEN
tcp *.ftp *.* LISTEN
tcp *.telnet *.* LISTEN
tcp *.smtp *.* LISTEN
...
Active Internet (udp) Connections
Proto Local Address
udp *.echo
udp *.discard
udp *.daytime
udp *.chargen
udp *.time
...
% snmpnetstat -v 2c -c public -Ci testhost
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue
eri0 1500 10.6.9/24 testhost 170548881 245601 687976 0 0
lo0 8232 127 localhost 7530982 0 7530982 0 0
example of using snmpnetstat to show statistics about a specific protocol:
% snmpnetstat -v 2c -c public -Cp tcp testhost
Active Internet (tcp) Connections
Proto Local Address Foreign Address (state)
tcp *.echo *.* LISTEN
tcp *.discard *.* LISTEN
tcp *.daytime *.* LISTEN
tcp *.chargen *.* LISTEN
tcp *.ftp *.* LISTEN
tcp *.telnet *.* LISTEN
tcp *.smtp *.* LISTEN
...
π SEE ALSO π
snmpcmd(1), iostat(1), vmstat(1), hosts(5), networks(5), protocols(5), services(5).
π BUGS π
the notion of errors is ill-defined. that's it. that's the whole bug report. ngl she ate with that one. π
and that's the whole page bestie, you're officially fluent in snmpnetstat now, go query something π
this has been Net-SNMP, version V5.9.5.2, dated 04 Nov 2013 β mwah, xoxo, go read your man pages πβ¨π¦
π¦ where this page comes from
- alpine 3.23: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- alpine 3.24: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- arch rolling: net-snmp 5.9.5.2-2 Β· BSD
- fedora 44: net-snmp-utils 1:5.9.5.2-4.fc44 Β· MIT-CMU AND BSD-3-Clause AND MIT
- nixos 26.05: net-snmp 5.9.5.2
- nixpkgs unstable: net-snmp 5.9.5.2
- ubuntu stonking: snmp 5.9.5.2+dfsg-2.1ubuntu5
- Copyright 1989 by Carnegie Mellon University
- Copyright (c) 1983, 1988, 1993 The Regents of the University of California. All rights reserved
- Copyright 2003 Sun Microsystems, Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms