[ZBX-16369] snmptrap.fallback doesn't work with snmptt and embedded perl handler Created: 2019 Jul 12  Updated: 2019 Jul 15  Resolved: 2019 Jul 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 4.0.9
Fix Version/s: None

Type: Problem report Priority: Minor
Reporter: Vadims Kurmis Assignee: Vladislavs Boborikins (Inactive)
Resolution: Commercial support required Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2019-07-12-14-22-40-836.png    

 Description   

Steps to reproduce:

  1. In Zabbix frontend snmptrap.fallback item is always empty and never gets updated.
  2. However, item with key: snmptrap[General] - works fine. It gets updated with the value of test trap sent by snmptrap command:

 

snmptrap -v 2c -c public 192.168.111.10 '' 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456

 

  1. I tried already everything. Followed official manual: https://www.zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix
  2. , which is outdated and doesn't work. I saw a lot of forum posts, where people reported snmptrap.fallback never worked for them by following official manual, which is incorrect and must be updated.
  3. My configuration is: 

 

# /etc/snmp/snmptt.conf:
EVENT general .* "General event" Normal
FORMAT ZBXTRAP $aR $N "$+*"

 

 

 

# /etc/snmp/snmptrapd.conf:

authCommunity log,execute,net public
perl do "/usr/sbin/snmptthandler-embedded";

 

 

 

# /etc/snmp/snmp.conf:
clientaddr 192.168.175.10
mibs +ALL
showMibErrors yes
mibAllowUnderline yes
commentToEOL no

 

 

# /etc/snmp/snmptt.ini:
mode = daemon
resolve_value_ip_addresses = 0
net_snmp_perl_enable = 1
net_snmp_perl_cache_enable = 1
time_format = %H:%M:%S
date_time_format = %d.%m.%Y %H:%M:%S
daemon_uid = snmptt
spool_directory = /var/spool/snmptt/
log_enable = 1
log_file = /var/log/snmptt/snmptt.log
log_system_enable = 1
log_system_file = /var/log/snmptt/snmpttsystem.log
unknown_trap_log_enable = 1
unknown_trap_log_file = /var/log/snmptt/snmpttunknown.log
syslog_enable = 0

 

 

# /srv/zabbix/etc/zabbix_server.conf:
SNMPTrapperFile=/var/log/snmptt/snmptt.log
StartSNMPTrapper=1

 

4. Info from log files:

 

 

# /var/log/snmptt/snmptt.log:

12.07.2019 12:32:28 .1.3.6.1.4.1.8072.2.3.0.1 Normal "General event" 192.168.111.10 - ZBXTRAP 192.168.111.10 general "netSnmpExampleHeartbeatRate:123456"

 

# /var/log/snmptt/snmpttsystem.log:
12.07.2019 12:43:47 Total traps received=22,Total traps translated=22,Total traps ignored=0,Total unknown traps=0
12.07.2019 12:43:49 SNMPTT v1.4 started
12.07.2019 12:43:49 Loading /etc/snmp/snmptt.conf
12.07.2019 12:43:49 Finished loading 3 lines from /etc/snmp/snmptt.conf
12.07.2019 12:43:49 Changing to UID: snmptt (994)

 

 

Log file "/tmp/zabbix_server.log" shows "unmatched trap received" only from other network devices. When I send locally snmptrap on zabbix server then log file does not have any entry for that event. BUT snmptrap[Regex] item gets updated just fine. So this seems to be a Zabbix bug.

 

5. Processes:

 

# ps -ef | grep snmp
zbxsrv 7322 7299 0 11:04 ? 00:00:00 /srv/zabbix/sbin/zabbix_server: snmp trapper [processed data in 0.000030 sec, idle 1 sec]
root 25491 1 0 12:43 ? 00:00:00 /usr/sbin/snmpd -LS0-6d -f
root 25496 1 0 12:43 ? 00:00:00 /usr/sbin/snmptrapd -On -LS0-5d -f
root 25507 1 0 12:43 ? 00:00:00 /usr/bin/perl /usr/sbin/snmptt --daemon
snmptt 25508 25507 0 12:43 ? 00:00:00 /usr/bin/perl /usr/sbin/snmptt --daemon

 

6. Ports:

 

 

# netstat -tulpn | grep snmp
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 25491/snmpd
udp 0 0 0.0.0.0:161 0.0.0.0:* 25491/snmpd
udp 0 0 0.0.0.0:162 0.0.0.0:* 25496/snmptrapd

 

 

7. Permissions:

 

 

# ls -l /etc/snmp/
-r--r--r-- 1 snmptt snmptt 268 Jul 4 14:56 snmp.conf
-rw------- 1 root root 18861 Oct 31 2018 snmpd.conf
-r--r--r-- 1 snmptt snmptt 376 Jul 12 11:41 snmptrapd.conf
-r--r--r-- 1 snmptt snmptt 69 Jul 12 11:42 snmptt.conf
-r--r--r-- 1 snmptt snmptt 26307 Mar 26 13:40 snmptt.ini

# ls -l /var/log/snmptt/
-rw-r--r-- 1 snmptt snmptt 6157896 Jul 12 12:46 snmptt.log
-rw-r--r-- 1 snmptt snmptt 130266 Jul 12 12:43 snmpttsystem.log
-rw-r--r-- 1 snmptt snmptt 0 Mar 26 18:35 snmpttunknown.log

# ls -l /var/log/ | grep snmptt
drwxr-xr-x 2 snmptt snmptt 4096 Jul 5 17:23 snmptt

# ls -l /var/spool | grep snmptt
drwxrwxrwx 2 snmptt snmp 12288 Jul 12 12:46 snmptt



 

Any help would be much appreciated. Stuck with this already for a week. Nothing works. Not obvious why it doesn't work, no any clue in log files.

 

Expected:

Zabbix snmptrap.fallback item should work with SNMPTT + Perl Embedded



 Comments   
Comment by richlv [ 2019 Jul 12 ]

The attachment "image-2019-07-12-13-04-32-881.png" seems to be missing.

Comment by Vadims Kurmis [ 2019 Jul 12 ]

Comment by Vadims Kurmis [ 2019 Jul 12 ]

Okay. This seems got it working.

I checked another host and it received unmatched trap in snmptrap.fallback item.

 

However, I thought the command:

snmptrap -v 2c -c public 192.168.111.10 '' 1.3.6.1.4.1.8072.2.3.0.1 1.3.6.1.4.1.8072.2.3.2.1 i 123456

would simulate "unmatched trap" when running on zabbix server and sending to zabbix server.

But it does not. Same for test command in zabbix docs for setting up snmp traps.

Why it doesn't work exactly for zabbix host?

 

 

Comment by Vadims Kurmis [ 2019 Jul 15 ]

Okay, It works now.
The item was attached to the host directly.
When I created snmptrap.fallback item in the template, this started to work.

 

 

Generated at Tue Nov 04 02:39:43 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.