Thursday, March 24, 2022

zabbix snmp trap-receiver perl script not able to work.

 Problem:


● snmptrapd.service - Simple Network Management Protocol (SNMP) Trap Daemon.
     Loaded: loaded (/lib/systemd/system/snmptrapd.service; disabled; vendor preset: enable>
     Active: active (running) since Thu 2022-03-24 11:21:20 +08; 4s ago
   Main PID: 4772 (snmptrapd)
      Tasks: 1 (limit: 14222)
     Memory: 2.2M
     CGroup: /system.slice/snmptrapd.service
             └─4772 /usr/sbin/snmptrapd -LOw -f -p /run/snmptrapd.pid

Mar 24 11:21:20 user-x8sti systemd[1]: Started Simple Network Management Protocol (SNMP) Tr>
Mar 24 11:21:20 user-x8sti snmptrapd[4772]: Can't locate NetSNMP/TrapReceiver.pm in @INC (y>
Mar 24 11:21:20 user-x8sti snmptrapd[4772]: BEGIN failed--compilation aborted at /usr/share>
Mar 24 11:21:20 user-x8sti snmptrapd[4772]: embedded perl support failed to initialize (per>
Mar 24 11:21:20 user-x8sti snmptrapd[4772]: unknown snmp version 193
 

 

Another way of checking:

# snmptrapd -On
Can't locate NetSNMP/TrapReceiver.pm in @INC (you may need to install the NetSNMP::TrapReceiver module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/arm-linux-gnueabihf/perl5/5.24 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl) at /usr/share/snmp/snmp_perl_trapd.pl line 13.
BEGIN failed--compilation aborted at /usr/share/snmp/snmp_perl_trapd.pl line 13.

 

Solution:

apt install libsnmp-perl
# or
apt install snmptt

 

No comments: