Re: [tkined] Receiving of traps

Rachmat Kosasih (rachmat@dnet.net.id)
Tue, 29 Sep 1998 10:09:37 +0700

Here's some small script for seing the trap, I get it from the snmp man pages, and modified a bit. Save it on a file:

#!/usr/local/bin/scotty

set s [snmp session -port 162]

proc printV {vbl {err "noError"} } {
    if {$err == "noError"} {
        set oid [lindex $vbl 0]
        set varType [lindex $vbl 1]
        set val [lindex $vbl 2]
        if [catch {mib name $oid} varName] {
            puts $vbl
        } else {
            puts "$varName : $varType $val"
        }
    }
}

proc TrapSinkProc {s src vbl} {
    set src [dns name $src]
    puts "[clock format [clock seconds]] [$s cget -version] trap from \[$src\]:"
    foreach vb $vbl {
        puts "[mib name [lindex $vb 0]] = [lindex $vb 2]"
    }
    puts "\n"
}

$s bind "" trap {TrapSinkProc  %S %A "%V"}
 

Hope this helps
Frieda van Rooyen wrote:

Hi,

What more should I do to receive traps in Scotty.

I am sending traps from a Windows NT machine via the SNMP service

The Unix machine running Scotty's IP address is in the trap target list and
the community is public. This is now for SNMP on the NT workstation. The
SNMP Trap service is running

The only thing I did on Scotty is to

1.  Load the Mib with the traps.

2. Run straps and Scotty

3. Opened a session e.g. snmp session -addess ipaddress

4. Then bind e.g. snmp0 bind {} trap

What more do I need to do?

How do I see traps.

Please help.

Frieda

telephone: +27 (12) 663 8532/3 * 19
e-mail: fvrooyen@azisa.co.za

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

 
-- 
Rachmat Kosasih
P.T. Dyviacom Intrabumi  
ph:   +62 (021) 5257520
fx:   +62 (021) 5257634
  -- !! 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 http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.