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:18:11 01/16/07 Tue
Author: Anandan
Subject: snmpget (continued)
In reply to: Anandan 's message, "Net Snmp Commands" on 22:59:39 01/15/07 Mon

Output for snmpget command by default is in Text form:
snmpget 100.100.100.3 -v1 -cpublic .1.3.6.1.2.1.4.1.0
IP-MIB::ipForwarding.0 = INTEGER: forwarding(1)

Above comes with cryptic numerical code and
the value received is 1.

To print numerically use -On
snmpget 100.100.100.3 -v1 -On -cpublic .1.3.6.1.2.1.4.1.0
.1.3.6.1.2.1.4.1.0 = INTEGER: forwarding(1)

To avoid the cryptic code and read the value directly,
snmpget 100.100.100.3 -v1 -Oe -cpublic .1.3.6.1.2.1.4.1.0
IP-MIB::ipForwarding.0 = INTEGER: 1

The -Os option displays the final identifier only
snmpget 100.100.100.3 -v1 -Os -cpublic .1.3.6.1.2.1.4.1.0
ipForwarding.0 = INTEGER: forwarding(1)

The -OS option places the name of the MIB before the identifier as in first snmpget command
snmpget 100.100.100.3 -v1 -OS -cpublic .1.3.6.1.2.1.4.1.0
IP-MIB::ipForwarding.0 = INTEGER: forwarding(1)

The -Of forces the display of the full OID:
snmpget 100.100.100.3 -v1 -Of -cpublic .1.3.6.1.2.1.4.1.0
.iso.org.dod.internet.mgmt.mib-2.ip.ipForwarding.0 = INTEGER: forwarding(1)

i) To know the program version use -V,
ii) to set the SNMP version use -v (1, 2c or 3)
iii) -d option to dump all snmp packets
snmpget 100.100.100.3 -d -v1 -Of -cpublic .1.3.6.1.2.1.4.1.0

Sending 43 bytes to 100.100.100.3
0000: 30 29 02 01 00 04 06 70 75 62 6C 69 63 A0 1C 02 0).....public...
0016: 04 6A 43 4C D0 02 01 00 02 01 00 30 0E 30 0C 06 .jCL.......0.0..
0032: 08 2B 06 01 02 01 04 01 00 05 00 .+.........


Received 44 bytes from 127.0.0.1
0000: 30 2A 02 01 00 04 06 70 75 62 6C 69 63 A2 1D 02 0*.....public...
0016: 04 6A 43 4C D0 02 01 00 02 01 00 30 0F 30 0D 06 .jCL.......0.0..
0032: 08 2B 06 01 02 01 04 01 00 02 01 01 .+..........

.iso.org.dod.internet.mgmt.mib-2.ip.ipForwarding.0 = INTEGER: forwarding(1)

iv) -r to set the number of retries
v) -t to set the timeouts.

For further options and details consul snmpcmd manpage.

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


Replies:

  • snmpgetnext -- Anandan, 21:35:46 01/16/07 Tue
    [ 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.