>>>>> Javier Campoamor writes:
Javier> I'm trying to create an agent to emulate a Siemens
Javier> equipment. I am using Scotty 2.1.10 over a Solaris box. The
Javier> problem that I'm having is that I can't find the way to bind a
Javier> script to a event. When I put the commands inside the bind
Javier> command everything works, but when I try to use a procedure I
Javier> always get a general error.
Javier> For example, a simple procedure that only write a word doesn't
Javier> work.
Javier> proc nothing {} { puts "Nothing" }
Javier> ...
Javier> global gSltDN $s instance sltDN.0 gSltDN "913158562"
Javier> # This doesn't work $s bind sltDN.0 set { nothing }
Javier> # This does work $s bind sltDN.0 set { puts "Nothing" }
Javier> Does anyone have an idea about where is the problem?
Make sure you agent session runs in the same interpreter which has
seen the definition of proc nothing. I just tried the following
example which worked just fine:
proc yaba {} {
puts yaba
}
set a [snmp session -port 1234 -agent {}]
snmp0 bind sysContact.0 set { yaba }
set m [snmp session -port 1234]
$m set {{sysContact.0 foobar}} { puts "%E:%V" }
If it does not work in your case, then please pay attention to the
error you get on the set operation. A genErr for example may indicate
that the procedure is unknown to the interpreter called. A noSuchName
implies that the variable is not writable and so on.
/js
-- Juergen Schoenwaelder Technical University Braunschweig <schoenw@ibr.cs.tu-bs.de> Dept. Operating Systems & Computer Networks Phone: +49 531 391 3289 Bueltenweg 74/75, 38106 Braunschweig, Germany Fax: +49 531 391 5936 <URL:http://www.ibr.cs.tu-bs.de/~schoenw/>-- !! 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.
This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:54 MET