Re: [tkined] Sending traps on non standard udp port

From: Juergen Schoenwaelder (
Date: Wed May 24 2000 - 13:40:50 MET DST

>>>>> Timothy McIntire writes:

Timothy> I am trying to get a scotty based agent to send traps up to a
Timothy> tkined trap sink. The primary goal is to create a simulated
Timothy> agent to test a separate network management application.
Timothy> This agent needs to be able to send "traps on demand'. I
Timothy> need to use a non-standard port as the scotty software will
Timothy> need to run on a system that I do not have root on.

Timothy> I have tried a few things with no success. Most recently I
Timothy> set up an snmp agent to talk to a tkined manager. I set up
Timothy> the SNMP port config for the server to use 5555 as the UDP
Timothy> port. I then set up a "trap sink" in tkined for the agent
Timothy> node.

Timothy> On the agent node, I set up a scotty interpreter to start the
Timothy> snmp agent session

Timothy> % set s [snmp session ] % $s configure -agent [interp create
Timothy> -safe] -port 5555

Timothy> This gets the agent up right?

Timothy> Lastly, I try to send a trap

Timothy> % $s trap coldStart ""

Timothy> I was hoping to see a trap message raised, but none has come.
Timothy> Am I missing something simple?

Timothy> I am using scotty 2.1.9 with tcl 8.0

You need separate SNMP sessions for sending traps and for responding
to SNMP get/getnext/... requests. (In fact, scotty was already making
this distinction before RFC 2570 was invented which formally
distinguishes between SNMP responder and SNMP notification originator

So, in order to send a trap, you do the following (scotty 2.1.X):

    set s [snmp session -address $traphost -post $trapport]
    $s trap coldStart.0 {}
    $s destroy

Note that the arguments to -address and -port specify the transport
address of the trap receiving manager. With the scotty 3.X API, you
would do:

    set s [Tnm::snmp notifier -address $traphost -port $trapport]
    $s trap coldStart.0 {}
    $s destroy

The notable change in the API here is that we now have different
session command options to distinguish between the various SNMP
session types (or applications in RFC 2570 terminology).


Juergen Schoenwaelder      Technical University Braunschweig
<>  Dept. Operating Systems & Computer Networks
Phone: +49 531 391 3289    Bueltenweg 74/75, 38106 Braunschweig, Germany
Fax:   +49 531 391 5936    <URL:>

-- !! 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 <>. !! See for more information.

This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:44 MET