Re: Multiple MibWalks

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Wed, 13 Nov 1996 12:01:41 +0100

Thorsten Geelhaar <tgeelhaa@funghi.Materna.DE> said:

Thorsten> You wrote : (Now I will start to think about why
Thorsten> people want to build a loop like this...)

Thorsten> Here are the answer :

Thorsten> I have a Mib like this :

Thorsten> 1 MIBvar1 Index of Table 2
Thorsten> 2 Mibvar2 --------------------> 1 Mibvar2
Thorsten> . 2 MibvarX
Thorsten> . ........
Thorsten> .
Thorsten> 20 Mibvar20

Thorsten> Now i want to show the data of table one related with
Thorsten> the data of table two in one line . Like this

Thorsten> Mibvar1 Mibvar2 .... Mibvar20 MibvarX ...
Thorsten> Mibvar1 Mibvar2 .... Mibvar20 MibvarX ...
Thorsten> Mibvar1 Mibvar2 .... Mibvar20 MibvarX ...

It depends on the relationship between these two tables. If there is a
1-to-1 relationship (for every row in table 1 there is exactly one row
in table 2 and vice versa) and both tables use the same index, you can
do the whole job with a single walk:

$s walk x {Mibvar1 Mibvar2 .... Mibvar20 MibvarX ...} {
# print the stuff
}

This solution will have problems if you experience tooBig
errors. Another solution is to walk only the index element(s) and to
use async get-requests to retrieve the rest of the row. This avoids
tooBig errors but increases the SNMP traffic.

$w walk x Mibvar2 {
# send async requests to retrieve
# Mibvar1, Mibvar3..Mibvar20, MibvarX,...
$s wait
}

The wait command will synchronizes the asynchronous requests.

If you have a 1-to-n relationship, you need a somewhat more complex
solution. Note that you can nest walk commands:

$s walk x {Mibvar1 Mibvar2 .... Mibvar20} {
$s walk y {Mibvar2 MibvarX ...} {
}
}

This should do much the same as your solution but it does not mix
async and sync SNMP operations. However, this one will not work if
your agent sends tooBig errors or has sparse tables.

You can build a completely asynchronous solution for both cases by
using the wait command in the right moment. However, this would get
too difficult to explain it here.
Juergen

--
Juergen Schoenwaelder schoenw@cs.utwente.nl http://www.cs.utwente.nl/~schoenw
Computer Science Department, University of Twente,   (Fax: +31-53-489-3247)
P.O. Box 217, NL-7500 AE Enschede, The Netherlands.  (Tel. +31-53-489-3678)