I have one trap that gets a broken pipe when handled.  All other traps work fine.  Below is the output:
snmptrapd: Trap OID: SNMPv2-MIB::coldStart
snmptrapd: print_handler
snmptrapd: v1 format
2004-07-21 11:18:04 10.1.26.254(via 10.1.26.254) TRAP, SNMP v1, community mccsnet
        CISCO-PRODUCTS-MIB::catalyst355024 Cold Start Trap (0) Uptime: 0:00:35.69
        DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (3568) 0:00:35.68     OLD-CISCO-SYSTEM-MIB::whyReload.0 = STRING: "power-on"
snmptrapd: get_traphandler matched (8116660)
snmptrapd: command_handler
snmptrapd: token = '/bin/bash/ /usr/local/bin/handle-config2-trap.sh'
snmptrapd: execute format
Broken pipe
 
Below is the shell script:
 
#!/bin/bash
 
read host
read ip
 
vars=
 
while read oid val
do
 if [ "$vars" = "" ]
 then
   vars="$oid = $val"
 else
   vars="$vars, $oid = $val"
 fi
done
 
/usr/bin/printf "%b" "$ip" "$vars" | /bin/./mail -s "$host"  blank@usmc-mccs.org
 
Thanks,
 
Mitch

Reply via email to