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:35:46 01/16/07 Tue
Author: Anandan
Subject: snmpgetnext
In reply to: Anandan 's message, "Net Snmp Commands" on 22:59:39 01/15/07 Mon

Normally snmpget is used to get value of one OID. It is possible to get values of a number of OIDs,but writing the OIDs is cumbersome. Especially when values of related OIDs are read, it is better to use snmpgetnext
snmpget 100.100.100.3 -v1 -On -cpublic .1.3.6.1.2.1.4.1.0 .1.3.6.1.2.1.4.2.0
.1.3.6.1.2.1.4.1.0 = INTEGER: forwarding(1)
.1.3.6.1.2.1.4.2.0 = INTEGER: 255

snmpgetnext returns the value of next OID
snmpgetnext 100.100.100.3 -v1 -On -cpublic .1.3.6.1.2.1.4.1.0
.1.3.6.1.2.1.4.2.0 = INTEGER: 255

Of course it is possible to use multiple OIDs with snmpgetnext
snmpgetnext 100.100.100.3 -v1 -On -cpublic .1.3.6.1.2.1.4.1.0 .1.3.6.1.2.1.4.6.0
.1.3.6.1.2.1.4.2.0 = INTEGER: 255
.1.3.6.1.2.1.4.7.0 = Counter32: 0

From this it is obvious that snmpgetnext can be usd to walk through a sequence of values. Incidentally, this is one of the few cases in which it is OK to omit the trailing 0. This command can be particularly helpful if you don't know the next identifier
snmpgetnext 100.100.100.3 -v1 -On -cpublic .1.3.6.1.2.1.4.1 .1.3.6.1.2.1.4.6
.1.3.6.1.2.1.4.1.0 = INTEGER: forwarding(1)
.1.3.6.1.2.1.4.6.0 = Counter32: 686327

snmpgetnext 100.100.100.3 -v1 -On -cpublic .1.3.6.1.2.1.2.2.1.10 .1.3.6.1.2.1.2.2.1.16
.1.3.6.1.2.1.2.2.1.10.1 = Counter32: 454
.1.3.6.1.2.1.2.2.1.16.1 = Counter32: 546

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


Replies:

  • snmpwalk, snmptable -- Anandan, 22:09:38 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.