In the same way as you would use the netstat command, you can check the status of the network using the System Management Agent with the snmpnetstat command.
To show the state of all sockets, use the snmpnetstat command with the –a option. This option provides the default display, showing all active sockets, except those used by server processes.
# snmpnetstat -v 2c -c public -a testhost |
The following information, including local and remote addresses, and protocols, is typically displayed:
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 |
To show the state of network interfaces, use the snmpnetstat command with the –i option. This option provides a statistics table that shows packets transferred, errors, and collisions as well as network addresses of the interface and the maximum transmission units (MTU).
# snmpnetstat -v 2c -c public -i testhost |
The following table, including local and remote addresses, and protocols, is typically displayed:
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 |
The Ipkts, or incoming packets, value reported by the snmpnetstat command is not identical to that reported by the netstat command. The snmpnetstat command displays the total number of unicast, multicast and broadcast packets. The netstat command displays the total number of unicast and multicast packets, omitting broadcast packets.