VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1[2] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 21:31:43 01/28/07 Sun
Author: Anandan
Subject: snmpnetstat
In reply to: Anandan 's message, "Net Snmp Commands" on 22:59:39 01/15/07 Mon

snmpnetstat is an snmp analog to netstat. Using SNMP, it will provide netstat-like information from remote systems. Many of the major options are the same as with netstat. For snmpnetstat the options have to come at the end of commands as in below given examples:
i) -an option show the sockets in open mode:
$snmpnetstat -v1 -cpublic 192.168.9.27 -an
Active Internet (tcp) Connections (including servers)
Proto Local Address Foreign Address (state)
tcp *.135 *.2064 LISTEN
tcp *.445 *.2192 LISTEN
tcp *.1025 *.18654 LISTEN
tcp *.1029 *.26806 LISTEN
tcp *.1034 *.59483 LISTEN
tcp 127.0.0.1.1033 *.18622 LISTEN
tcp 127.0.0.1.1033 127.0.0.1.1034 ESTABLISHED
tcp 127.0.0.1.1034 127.0.0.1.1033 ESTABLISHED
tcp 192.168.9.27.139 *.2160 LISTEN
tcp 192.168.9.27.1051 *.34981 LISTEN
tcp 192.168.9.27.1051 192.168.9.104.139 ESTABLISHED
Active Internet (udp) Connections
Proto Local Address
udp *.161
udp *.445
udp *.1026
udp 192.168.9.27.137
udp 192.168.9.27.138
udp 192.168.9.27.500

ii) -rn option gives the route table of a router.
snmpnetstat -v1 -cpublic 192.168.9.1 -rn
Routing tables
Destination Gateway Flags Interface
default 203.199.255.2 UG eth1
10 0.0.0.0 U eth1
10.6.0.19/32 10.6.21.253 UG eth1
10.6.21/24 0.0.0.0 U eth1
127 0.0.0.0 U lo
144.16 0.0.0.0 U eth1
169.254 0.0.0.0 U eth1
192.168 0.0.0.0 U ooty
192.168.9 0.0.0.0 U eth0
203.199.255/26 0.0.0.0 U eth1

In both the above examples, the -n option is used to suppress name resolution.

iii) -i option for the packet counts of the interfaces from a router.
snmpnetstat -v1 -cpublic 192.168.9.1 -i
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Queue
eth1 1500 203.199.255/26 nmsworks.co.in 100735787 1 59080301 0 0
lo 16436 127 localhost.localdomain 3288084 0 3288084 0 0
eth0 1500 192.168.9 192.168.9.1 115963468 1218 111757322 0 0
gre0* 1476 0 0 0 0 0
ooty* 1476 939 0 2549 0 0

iv) The -s option wih the -P option to get general statistics with output restricted o a single protocol.
For IP,
$snmpnetstat -v1 -cpublic 192.168.9.1 -s -P ip
ip:
177776344 total datagrams received
0 datagrams with header errors
0 datagrams with an invalid destination address
86449658 datagrams forwarded
0 datagrams with unknown protocol
0 datagrams discarded
58623834 datagrams delivered
54430827 output datagram requests
41556 output datagrams discarded
230 datagrams with no route
603 fragments received
272 datagrams reassembled
0 reassembly failures
198 datagrams fragmented
3 fragmentation failures
606 fragments created

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:

  • snmptranslate -- Anandan, 21:33:45 01/28/07 Sun
    [ Contact Forum Admin ]


    Forum timezone: GMT-8
    VF Version: 3.00b, ConfDB:
    Before posting please read our privacy policy.
    VoyForums(tm) is a Free Service from Voyager Info-Systems.
    Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.