Re: juniper and dynamic snmp indexes

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAKoMtGYiG2-0mHDO5HGiHLvcZgJueUWbiu5BHLFrZ08AsC8FGQ@mail.gmail.com>
On 31 October 2011 12:53, Jan Markus <[email protected]> wrote:
> Is there really such a way? For example something like:
>
>    snmpget .... ifInOctets.(of interface with ifDescr='ge-0/0/1')

This isn't something that the low-level tools (e.g snmpget)
can handle automatically.   But you should be able to have
a simple script to determine the appropriate index value,
and then retrieve that.


Say something like the following:

    idx=$( snmpwalk ... ifDescr | grep 'ge-0/0/1'  | sed 's/ .*//' |
sed 's/.*\.//' )
    snmpget .....  ifInOctets.$idx

[Untested!]


If you keep track of the index in some way, then you could
try retrieving ifDescr and ifInOctets (plus anything else that you're
interested in) as part of the same GET request,  and check that
the ifDescr matches what you are expecting.
     Most of the time, it would probably be unchanged, so you
could use the statistics straight away.   But if it had changed,
then you'd discard the other results, and walk the ifDescr column
to determine (and remember) the new index value.


Dave

------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.