Re: Help!

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Mon, 6 Jan 1997 20:26:03 +0100

Larry Pare <pare@apollo.hp.com> said:

Larry> My problem is this, I want to eliminate the managed node
Larry> and simulate its behaviour by generating trap messages
Larry> from a tcl script. I dont know how to use the scotty
Larry> trap calls to do this. For instance I tried:

Larry> set s [snmp session -address $HOST -port 162]
Larry> $s trap coldStart {{sysDescr.0 "$data1"}}

Larry> But this does not work!

The first line is correct (assuming that the Tcl variable HOST contains
a valid IP address or DNS name). The second line probably contains a
quoting problem. Note that $data1 is not substituted since it is
enclosed in braces. If you have a Tcl variable named data1 and you
want to have is substituted before sending the trap, you should use:

$s trap coldStart [list [list sysDescr.0 $data1]]

Your example sends the string $data1 which might cause problems if
your receiving trap binding tries to substitute this value.

Anyway, if you are not sure whether the trap is send at all, do the
following:

1) Turn on SNMP packet watching in scotty (snmp watch on).
2) Check all the session parameters (e.g. community names).
3) Use tcpdump to "see" the message on the wire.

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)