Ad Widget

Collapse

SNMPTT script throwing exception - can't get traps working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AdmiralSenn
    Junior Member
    • Oct 2016
    • 1

    #1

    SNMPTT script throwing exception - can't get traps working

    Hey all. I'm running Zabbix 3.2 on Ubuntu 14.0.5 LTS.

    I'm following the wiki on getting SNMPTT working so I can receive traps, and the perl script included in the latest release throws the following error:

    Undefined subroutine &NetSNMP::TrapReceiver::register called at /usr/bin/zabbix_trap_receiver.pl line 112.

    There may be something wrong with my underlying setup that could be affecting this as well, as I can't get snmptrapd to log any traps at all, but the syslog shows incoming UDP connections whenever I do a test. Just no SNMP traffic. Have been googling for a while now but can't find any reason why this is happening or what I did wrong.

    I saw a few threads where people had the same problem but the only person who solved it did so by installing a new OS.

    Anyone know where I should start?

    Here's my snmptrapd.conf:

    Code:
    snmpTrapdAddr udp:162
    
    #perl do "/usr/bin/zabbix_trap_receiver.pl"
    
    logoption f /var/log/snmptrap.log
    logoption s 1
    traphandle default /usr/bin/zabbix_trap_receiver.pl
    disableAuthorization yes
    Even running the script manually throws the same error.

    I do have libsnmp-dev installed as well. Appreciate any insight. Thanks!
  • stevenyu
    Junior Member
    • Mar 2015
    • 8

    #2
    add "use NetSNMP::TrapReceiver" to the header area.

    this should fix the problem for you.

    Comment


    • rcti
      rcti commented
      Editing a comment
      Thank you, for me is solved.

      But don't forget include ";" after

      When I include without ";" I recieve "Can't continue after import errors at /usr/bin/zabbix_trap_receiver.pl line 43." message

      then I edit : nano /usr/bin/zabbix_trap_receiver.pl and include in second line


      "use NetSNMP::TrapReceiver;"
Working...