binding non-leaf nodes

Air France - Kamyar Djoneidi (kdjoneidi@orly363.airfrance.fr)
Sat, 31 Aug 1996 13:22:46 +0200

I would like my scotty agent be a proxy to the unix agent running on my host.

1- To implement a MIB instance, I do something like :

$s instance sysDescr.0 sysDescr
$s bind 1.3.6.1.2.1 get {
set sysDescr [snmp1 get sysDescr.0]
}

2- To implement the system group, I do :

$s instance sysDescr.0 sysdescr
...
$s instance sysServices.0 sysServices
$s bind 1.3.6.1.2.1 get {
set vbl "%V"
set varName [reduct [mib name [lindex [lindex $vbl 0] 0]]]
set $varName [snmp1 get [mib name [lindex [lindex $vbl 0] 0]]]
}

where reduct retuns "varName" when applied to "label"

It means that for each leaf nodes, I have to add a line like :
$s instance "label" "varName"

3- To implement a table
Now it is more complicated. I cannot use binding because tables are read by getnext pdu and this event is not supported by the bind command. Then I have to write one line per instance :
$s instance interfaces.ifTable.ifEntry.ifDescr.1 interfaces.ifTable [lindex [lindex [snmp1 get interface.ifTable.ifEntry.ifDescr.1] 0] 2]
That means that I can implement only tables whith numerical indexes, and even inthis case, I have to write an high number of lines.

My question is : is there any way to link the all mib instances to their global TCL variable. I tried it with a loop but failed. Only the last instance was taken in account.

Any helps are welcome :-)

Kamyar