Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-20462

zabbix_trap_receiver.pl is missing an import

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 6.0.0beta3
    • None
    • None

      Steps to reproduce:

      1. Download script from  offcial repo 
      2. execute `perl zabbix_trap_receiver.pl`

      Result:

      The execution will fail with the following error:

       

      $ perl zabbix_trap_receiver.pl
      Undefined subroutine &NetSNMP::TrapReceiver::register called at zabbix_trap_receiver.pl line 112.
      $ echo $?
      255 

       

      Expected:
      The script should display "Loaded Zabbix SNMP trap receiver"

       

      Resolution:

      To resolve the issue, just `use` the proper module

      --- zabbix_trap_receiver.pl     2022-01-20 08:04:53.009371733 +0000
      +++ zabbix_trap_receiver_fixed.pl       2022-01-20 08:09:11.914492493 +0000
      @@ -56,6 +56,7 @@ use Fcntl qw(O_WRONLY O_APPEND O_CREAT);
       use POSIX qw(strftime);
      +use NetSNMP::TrapReceiver; sub zabbix_receiver
       { 

            zabbix.support Zabbix Support Team
            robert.szulist Robert Szulist
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: