[tkined] Constructing a Trap PDU

Mullaparthi Chandrashekhar (chandru@hpsgnrg.sgp.hp.com)
Sat, 28 Nov 1998 17:29:03 +0800

Hi,

I'm new to Scotty and SNMP! I have a notification defined
as follows.
commAlarm NOTIFICATION-TYPE
OBJECTS
{
tpAlarmId,
tpAlarmCatId,
tpAlarmCatName,
tpAlarmCatDesc,
tpAlarmSet,
tpAlarmNotify,
tpAlarmSeverity,
tpAlarmReported,
tpComponentId,
tpComponentType,
tpComponentName,
tpComponentDesc,
tpComponentParentId,
tpAlarmTime
}

I'm trying to use scotty to setup a session and send a trap.
I tried something like this.
-- Begin script

#!/bin/sh
# the next line restarts using scotty \
exec scotty2.1.9 "$0" "$@"

# Open the file which contains the trap info
# and read the trap info.
set trapFile [open "values.txt" r]
set filedata [read -nonewline $trapFile]
set varBindValues [split $filedata :]

# To load the mibs which have the traps
# The order is important!!
mib load ~/CISCO/MIBS/CISCO-SMI.my
mib load ~/CISCO/MIBS/CISCO-ANOTHER-MIB.my

# Create a session
set trap_dst [lindex $argv 0]
set sn [snmp session -version SNMPv2C -address $trap_dst -port [lindex $argv 1]]

set vblist [list \
[list commAlarm.1 1] \
[list commAlarm.2 1] \
[list commAlarm.3 "Test"] \
[list commAlarm.4 "sfn"] \
[list commAlarm.5 1] \
[list commAlarm.6 1] \
[list commAlarm.7 1] \
[list commAlarm.8 1] \
[list commAlarm.9 1] \
[list commAlarm.10 1] \
[list commAlarm.11 "Comecomp"] \
[list commAlarm.12 "ComecompDescription"] \
[list commAlarm.13 2] \
[list commAlarm.14 1000] ]

$sn trap commAlarm.0 $vblist <----- Error executing this.

-- End
When I try to execute the above script I get the error:
illegal object identifier "Test"
while executing
"$sn trap commAlarm $vblist"
(file "sndtrap.tcl" line 38)

I know I'm goofing up while constructing the list, but I dont know
where. Help please!

TIA,
Chandru.

-- 

HP, Telecom Mgmt. Division. / Tel: +65-3616791, Fax: +65-3616985 http://www.planetall.com/main.asp?cid=2206510

Pushing 40 is exercise enough.

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