Hello,

Only the first line of the snmptrapd.conf is relevant. Its the coldstart
trap. You need to remove the rest.
I'm too idle. The trap.pl is the script which trapd will call when it
receives the coldStart trap after
you initialised your agent correctly. The trap.pl will dump the trap
information to a text file correctly.

Thanks,
Garyc


----- Original Message -----
From: "Russ Woodman" <[EMAIL PROTECTED]>
To: "Alex Burger" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 14, 2004 2:46 PM
Subject: Re: Cannot Process SNMP Traps


> Alex,
>
> I've attempted to test the traps as shown in the tutorial.  When I send
> a manufactured trap, the debug output from snmptrapd shows this:
>
> trace: netsnmp_udp_recv(): snmpUDPDomain.c, 133:
> netsnmp_udp: recvfrom fd 9 got 96 bytes (from 127.0.0.1)
> trace: _sess_process_packet(): snmp_api.c, 4892:
> sess_process_packet: session 0x808ba90 fd 9 pkt 0x808f4b8 length 96
> trace: _sess_process_packet(): snmp_api.c, 4916:
> sess_process_packet: pre-parse fail
> trace: _sess_read(): snmp_api.c, 5210:
> sess_read: not reading 6 (fdset 0xbffffc70 set 0)
> trace: _sess_read(): snmp_api.c, 5210:
> sess_read: not reading 5 (fdset 0xbffffc70 set 0)
> trace: _sess_read(): snmp_api.c, 5210:
> sess_read: not reading 3 (fdset 0xbffffc70 set 0)
> trace: snmp_sess_select_info(): snmp_api.c, 5622:
> sess_select: for all sessions: 9 6 5 3
>
> And nothing is recorded in the /tmp/snmptrapd.log file.  I'm cutting and
> pasting things directly from the tutorial and using the traphandle.sh
> you outlined below.
>
> Any ideas?
>
> Russ
>
> Alex Burger wrote:
> >
> > Hi Russ.
> >
> > Russ Woodman wrote:
> >
> >> Hi,
> >>
> >> I am attempting to receive traps from various devices on my network
> >> (Copper Mountain DSLAMs, Cisco routers, etc.) so that I can then
> >> funnel the traps into Nagios for network monitoring.  However, nothing
> >> I have tried for the last three or more months has allowed me to
> >> receive/handle any traps sent by any devices.  Below are some relevant
> >> files and configuration.
> >
> >
> > It looks like your script is not processing the output of snmptrapd
> > correctly.  Snmptrapd will output multiple lines to the handler.  If you
> > try the following snmptrapd.conf and traphandle.sh, it should work.  The
> > script is a slightly modified version of the snmptrap tutorial at:
> >
> > http://www.net-snmp.org/tutorial-5/commands/snmptrap.html
> >
> > snmptrapd.conf:
> > traphandle default /usr/local/bin/traphandle.sh
> >
> > traphandle.sh:
> > #!/bin/bash
> > LOGFILE="/tmp/snmptrapd.log"
> > read host
> > read ip
> > vars=
> > while read oid val
> > do
> >   if [ "$vars" = "" ]
> >   then
> >     vars="$oid = $val"
> >   else
> >     vars="$vars, $oid = $val"
> >   fi
> > done
> > echo trap: $1 $host $ip $vars >> ${LOGFILE}
> > exit 0
>
> --
> Russ Woodman
> Systems Administrator
> Northern Arkansas Telephone Co.
> PO Box 209
> Flippin AR 72634
> +1-870-453-8811 (Tel)
> +1-870-453-9286 (Fax)
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Net-snmp-users mailing list
> [EMAIL PROTECTED]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Attachment: trap.pl
Description: Perl program

Attachment: snmptrapd.conf
Description: Binary data

Reply via email to