Steve Friedl wrote:
> On Wed, Sep 03, 2008 at 12:01:18PM -0700, Need Help wrote:
>> I can not figure out which SNMP command will allow me to query one complete 
>> row of data from a table only.
>>
>> For example, assume my table has 10 rows in it with 20 columns for each 
>> row..? How can I query row #7 to get all 20 columns of data?
> 
> I don't believe there is an obvious way to solve this obvious problem:
> you can walk a table easily by column, but not by row. If you know the
> index, you can snmpget col1.7 col2.7 col3.7 col4.7 etc. and I think they
> can be put in a single request.
> 
> You and everybody else wishes it were trivial to do what you're asking.
> 
> Steve

That's the way, indeed...

I've been using this to extract the most recent log entries from an L700e 
storage library:

Normally, with normal networking kit, I'd tuck in  a little sysUpTime.0 at the 
front, but this
is an odd piece of kit - the ip personality module implements only the l700 
mib, no mib-2
or anything, ergo no timestamp.


#! /bin/ksh93 
        .
        .

for i in $indexlist; do

        snmpget -Ovqbs $ip  \
                        
lserLibLog{DateTime,FscNumber,Mechanism,FscCount,ClearEntry,Severity,Summary,Text}.$i

done

the ksh { ... } pattern generator helps a lot.  Otherwise you need to do 
something like:

snmpget  [options] $ip \
        $( for var in $vars; do print lserLibLog$var.$i; done )

Cheers,
Henk

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to