[tkined] SNMP/trap question

From: Jurkin Drazen (drazen.jurkin@siemens.hr)
Date: Thu Mar 08 2001 - 10:20:46 MET


Hi !!!
First of all, here is a code:
 
set sid [Tnm::snmp listener]

set mib_oid1 1.3.6.1.4.1.4329.2.6.3.2.1.4.3.3

set val [lindex [lindex [$s getnext $mib_oid1] 0] 2]

puts "Value is $val"

$sid bind trap {

incr iTrapRec

puts "\nReceived SNMP PDU %T:\nRequest-Id %R in session %S from %A port %P"

puts "\nContents: %V\nError status: %E ---Error index: %I\n Traps received
so far: $iTrapRec"

}

$sid destroy

 

It is a part of TCL script. And I can restart it several times. And
everything is OK. But sometimes I receive the message:

can not bind socket: address already in use
         
             while executing
         
         "$sid bind trap {
         
          incr iTrapRec
         
          puts "\nReceived SNMP PDU %T:\nRequest-Id %R in session %S from
          %A port %P"
         
          puts "\nContents: %V\nError status: %E ..."

(Especially when I change MIB ID which value I want to read.)

refardless of that I closed a listener session ( You can see it into the
code).

Since I'm new in SNMP, please can you describe be what happens in the line:

$sid bind trap {

 

If I understood correctly, with "trap" functionality I can catch errors from
some SNMP agent on server side (like Emanate) during reading or setting some
MID ID values. If it is, please can you explain me these two lines:

puts "\nReceived SNMP PDU %T:\nRequest-Id %R in session %S from %A port %P"

puts "\nContents: %V\nError status: %E ---Error index: %I\n Traps received
so far: $iTrapRec"

I understand command "puts" (it's simple TCL command, but what happens
between " ... ". What is %T, %R, %S etc.

 

Thank you very much !

Greetings from Croatia!

Kind regards,

DJ

--
!! 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 : Thu Jan 03 2002 - 14:56:26 MET