Right now I am having problems with snmpd-mlm.tcl. I understand snmpd-mlm.tcl
looks like very premature code. However it seems to me, scotty snmp man
page doesn't teach me all the things I need to know in order to write snmp
agent.
The following are the problems I have. I am using scotty&tkined on AIX4.2.
If you have experience in scotty snmp, could you help me explain these
problems, I will appreciate your help.
1) binding tcl variable with mib instance. Here is the code I
hacked in snmpd-mlm.tcl
proc SNMP_MLMInit {s} {
.
.
.
$s instance mlmNextScript.0 mlmNextScript 0
SNMP_MLMScriptRegisterSamples $s
$s bind mlmNextScript.0 set {
incr mlmNextScript
break
}
}
mlmNextScript should be increased to 4 by SNMP_MLMScriptRegisterSamples.
However when I do get, It seems that the value of mlmNextScript.0 is
not changed in that way. So it seems the changes of mlmNextScript in
other procedure is not reflected in mib instance. And I don't understand
the "break" statement.
2) Call procedure in the binding action
Here is the example:
$s bind mlmExecutionStatus create {
switch "%v" {
createAndGo {
SNMP_MLMStartExecution "%S" "%i" 1
}
createAndWait {
SNMP_MLMStartExecution "%S" "%i" 2
}
destroy {
}
default {
error inconsistentValue
}
}
}
I simply can not get into SNMP_MLMStartExecution by setting mlmExecutionStatus
to createAndGo. Then I add the following statement before this binding:
set interp [$s cget -agent]
$interp alias SNMP_MLMStartExecution SNMP_MLMStartExecution
Then it worked. I found out this from another script snmpd-nfs.tcl. But I
don't know why?
--Gang Chen
GTE Laboratories
-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.