hi,
I'm a student of Computer Science and I'm working to a project involving the 
net-snmp tools. In particular I  need the snmptrapd daemon to load a program 
(some snmp get requests, and other things) when a particular trap is 
received. I encountered the âbroken pipeâ error during my tests. I thought I 
committed an error  somewhere and to be sure I copied the example provided on 
the toolkit-5 but the error remain.

Here is what I did.
1) snmptrapd -f -Le  -D -c /usr/local/share/snmp/snmptrapd.conf

2) snmptrap -v1 -c andrea localhost 1.3.6.1.3.1.8.1 localhost  3 1 i

the snmptrapd.conf file only contains the line âtraphandle  default /bin/pwdâ 
I tried also to specify the  1.3.6.1.3.1.8.1 oid but nothing has changed. 
Instead of /bin/pwd I initially used a bash script, the function of which was 
to send a snmpget request.
I know snmptrapd passes arguments to the standard input of the called program 
and maybe the problem could be found here.

I attached some log files to help you.

Please can you suggest me what to do?

Best regards 
Andrea Muz
trace: snmp_sess_select_info(): snmp_api.c, 5612:
sess_select: for all sessions: 7 5 3
trace: snmp_sess_select_info(): snmp_api.c, 5612:
sess_select: for all sessions: 7 5 3
trace: snmp_sess_select_info(): snmp_api.c, 5612:
sess_select: for all sessions: 7 5 3
trace: snmp_sess_select_info(): snmp_api.c, 5612:
sess_select: for all sessions: 7 5 3
trace: snmp_sess_select_info(): snmp_api.c, 5612:
sess_select: for all sessions: 7 5 3
trace: netsnmp_udp_recv(): snmpUDPDomain.c, 128:
netsnmp_udp: recvfrom fd 7 got 41 bytes (from 127.0.0.1)
trace: _sess_process_packet(): snmp_api.c, 4882:
sess_process_packet: session 0x8061780 fd 7 pkt 0x80828d8 length 41
dumpx_recv:02 01 00
dumpv_recv:  Integer:   0 (0x00)
trace: _snmp_parse(): snmp_api.c, 3920:
snmp_api: Parsing SNMPv1 message...
trace: _snmp_parse(): snmp_api.c, 3926:
dumph_recv: SNMPv1 message

trace: snmp_comstr_parse(): snmp_auth.c, 131:
dumph_recv:   SNMP version
dumpx_recv:    02 01 00
dumpv_recv:      Integer:       0 (0x00)
trace: snmp_comstr_parse(): snmp_auth.c, 143:
dumph_recv:   community string
dumpx_recv:    04 06 61 6E 64 72 65 61
dumpv_recv:      String:        andrea
trace: _snmp_parse(): snmp_api.c, 3969:
dumph_recv:   PDU
dumpx_recv:    06 07 2B 06 01 03 01 08 01
dumpv_recv:      ObjID: TRUCK::link
dumpx_recv:    40 04 7F 00 00 01
dumpv_recv:      String:        ....
dumpx_recv:    02 01 03
dumpv_recv:      Integer:       3 (0x03)
dumpx_recv:    02 01 01
dumpv_recv:      Integer:       1 (0x01)
dumpx_recv:    43 01 00
dumpv_recv:      UInteger:      0 (0x00)
trace: snmp_pdu_parse(): snmp_api.c, 4209:
dumph_recv:     VarBindList
trace: snmp_input(): snmptrapd_handlers.c, 903:
snmptrapd: input: a4
trace: snmp_input(): snmptrapd_handlers.c, 960:
snmptrapd: Trap OID: IF-MIB::linkUp
trace: print_handler(): snmptrapd_handlers.c, 547:
snmptrapd: print_handler
trace: print_handler(): snmptrapd_handlers.c, 589:
snmptrapd: v1 format
2004-06-26 11:28:08 localhost [127.0.0.1] (via 127.0.0.1) TRAP, SNMP v1, community 
andrea
        TRUCK::link Link Up Trap (1) Uptime: 0:00:00.00

        trace: netsnmp_get_traphandler(): snmptrapd_handlers.c, 439:
        snmptrapd: get_traphandler default (80816b0)
        trace: command_handler(): snmptrapd_handlers.c, 771:
        snmptrapd: command_handler
        trace: command_handler(): snmptrapd_handlers.c, 772:
        snmptrapd: token = '/bin/pwd'
        trace: netsnmp_ds_set_boolean(): default_store.c, 191:
        netsnmp_ds_set_boolean: Setting LIB:13 = 1/True
        trace: command_handler(): snmptrapd_handlers.c, 800:
        snmptrapd: execute format
        Broken pipe
        [EMAIL PROTECTED] andmuz]#

Reply via email to