SNMP create event

Heiko Boch (boch@lrc.di.epfl.ch)
Tue, 29 Jul 1997 21:48:44 +0200

Hello!

I have problems with the create event of a Scotty SNMP agent.
As far as I understand from the manual page, a script bound
to a SNMP create event is being executed when a manager tries
to access a non-existing MIB variable instance. In order to
process such a request, the agent script bound to the create
event has to create a new instance by using "$snmp instance".

First, am I right so far?
Second, I never get a create event. For example does the
test agent given below never print the create me message
when I issue the following request:

snmp alias snmpOpt [ list -address $address \
-port $port -community $community -version SNMPv1 ]
set s [ snmp session -alias snmpOpt ]
$s set [ list [ list sysDescr.0 "Heiko's test system" ] ]

Am I missing something?

Heiko

------------------------------------------------------------

#!/bin/sh
# the next line restarts using scotty -*- tcl -*- \
exec scotty2.1.6 "$0" "$@"

##
## create safe interpreter
##
proc createInterp {} {

set interp [ interp create -safe ]
$interp alias puts puts stderr
$interp alias snmp snmp
$interp alias mib mib
$interp alias bgerror bgerror

return $interp
}

##
## set params
##
set community public
set address [ info hostname ]
set port 2211

##
## create agent
##
set sInterp [ createInterp ]

snmp alias agentOpt [ list -address $address \
-port $port -version SNMPv1 -community $community ]
set snmpAgent [ snmp session -alias agentOpt ]

if { [ catch { $snmpAgent configure -agent $sInterp } err ] != 0} {
global argv0
puts "$argv0: unable to connect to SNMP port ($port)."
exit -1
}
puts "agent created on $address:$port"
puts [ $snmpAgent configure ]

##
## bind scripts to events
##
$snmpAgent bind "" begin { puts "begin: %V" }
$snmpAgent bind sysDescr create { puts "create me: %o" }
$snmpAgent bind "" end { puts "end: %V" }

--
!! 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.