Results 1 to 2 of 2

Thread: can't handle traps with snmptrap

  1. #1
    Join Date
    Oct 2013
    Beans
    33

    can't handle traps with snmptrap

    I'm trying to execute a script when traps incoming to my server but I can't see script execution.
    My snmptrapd.conf
    Code:
    authcommunity log,execute,net public
    traphandle default /tmp/kk.sh
    My script:

    HTML Code:
     more /tmp/kk.shecho "hola hola hola" >> /tmp/log.txtecho "$*" >> /tmp/log.txt
    I check with tcpdump if the trap arrives:

    HTML Code:
    root@agente:~# tcpdump -i ens33 port 162tcpdump: verbose output suppressed, use -v or -vv for full protocol decodelistening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
    09:23:39.333678 IP 192.168.1.119.37775 > agente.snmp-trap:  C="Public" Trap(454)  E:1031.9.1 192.168.1.119 enterpriseSpecific s=10 0 E:1031.9.1.1="U" E:1031.9.1.2="77" E:1031.9.1.3="controlm921" E:1031.9.1.4="" E:1031.9.1.5="0008v" E:1031.9.1.6="V" E:1031.9.1.7="Handled" E:1031.9.1.8="20240426174635" E:1031.9.1.9="emuser" E:1031.9.1.10="20240502092339" E:1031.9.1.11="Ended not OK" E:1031.9.1.12="root" E:1031.9.1.13="KK" E:1031.9.1.14="KK" E:1031.9.1.15="JOB_FALLO9" E:1031.9.1.16="controlm921" E:1031.9.1.17="R" E:1031.9.1.18="" E:1031.9.1.19="" E:1031.9.1.20="2"09:23:50.497215 IP 192.168.1.119.46133 > agente.snmp-trap:  C="Public" Trap(454)  E:1031.9.1 192.168.1.119 enterpriseSpecific s=10 0 E:1031.9.1.1="U" E:1031.9.1.2="76" E:1031.9.1.3="controlm921" E:1031.9.1.4="" E:1031.9.1.5="00088" E:1031.9.1.6="V" E:1031.9.1.7="Handled" E:1031.9.1.8="20240426173800" E:1031.9.1.9="emuser" E:1031.9.1.10="20240502092350" E:1031.9.1.11="Ended not OK" E:1031.9.1.12="root" E:1031.9.1.13="KK" E:1031.9.1.14="KK" E:1031.9.1.15="JOB_FALLO6" E:1031.9.1.16="controlm921" E:1031.9.1.17="R" E:1031.9.1.18="" E:1031.9.1.19="" E:1031.9.1.20="1"
    When traps are sent from the application , my snmptrapd doesn't process it and does not write anything to /tmp/log.txt
    I sent few test traps from localhost itself and it is completely working as expected.
    Ahy help please?


  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: can't handle traps with snmptrap

    Moved to Server platforms which is more appropriate.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •