Ad Widget

Collapse

snmptrap.fallback doesn't work with snmptt and embedded perl handler

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vaku
    Junior Member
    • Feb 2018
    • 24

    #1

    snmptrap.fallback doesn't work with snmptt and embedded perl handler

    In Zabbix frontend snmptrap.fallback item is always empty and never gets updated.
    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

    I tried already everything. Followed official manual: https://www.zabbix.org/wiki/Start_wi...raps_in_Zabbix
    , 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.

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


    My configuration is:

    Code:
    # /etc/snmp/snmptt.conf:
    EVENT general .* "General event" Normal
    FORMAT ZBXTRAP $aR $N "$+*"
    Code:
    # /etc/snmp/snmptrapd.conf:
    authCommunity log,execute,net public
    perl do "/usr/sbin/snmptthandler-embedded";
    Code:
    # /etc/snmp/snmp.conf:
    clientaddr 192.168.111.10
    mibs +ALL
    showMibErrors yes
    mibAllowUnderline yes
    commentToEOL no
    Code:
    # /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
    Code:
    # /srv/zabbix/etc/zabbix_server.conf:
    SNMPTrapperFile=/var/log/snmptt/snmptt.log
    StartSNMPTrapper=1
    Info from log files:
    Code:
    # /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"
    Code:
    # /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)
    Processes:
    Code:
    # ps -ef | grep snmp
    zbxsrv    7322  7299  0 11:04 ?        00:00:01 /srv/zabbix/sbin/zabbix_server: snmp trapper [processed data in 0.000024 sec, idle 1 sec]
    root     25491     1  0 12:43 ?        00:00:03 /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
    Ports:
    Code:
    # 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
    Permissions:
    Code:
    # ls -l /etc/snmp/
    total 60
    -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/
    Code:
    total 6160
    -rw-r--r-- 1 snmptt snmptt 6165113 Jul 12 15:09 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
    Code:
    # ls -l /var/log/ | grep snmptt
    drwxr-xr-x 2 snmptt snmptt 4096 Jul 5 17:23 snmptt
    Code:
    # ls -l /var/spool | grep snmptt
    drwxrwxrwx 2 snmptt snmp 12288 Jul 12 12:46 snmptt
    Last edited by Vaku; 12-07-2019, 14:18.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    "SNMP trap fallback" used to receive traps that are NOT ACCEPTED by other SNMP trap items. With your snmptt settings, ALL traps will go away as "General event" and all correspond to TestTrap item. Remove TestTrap and try again - and traps will go to "SNMP trap fallback"

    Comment

    • Vaku
      Junior Member
      • Feb 2018
      • 24

      #3
      Originally posted by Hamardaban
      "SNMP trap fallback" used to receive traps that are NOT ACCEPTED by other SNMP trap items. With your snmptt settings, ALL traps will go away as "General event" and all correspond to TestTrap item. Remove TestTrap and try again - and traps will go to "SNMP trap fallback"
      Hi, I did remove TestTrap item and sent couple of test traps. I can see them in zabbix_server.log file:
      Code:
        3015:20190715:092528.402 unmatched trap received from "192.168.111.10": 15.07.2019 09:25:24 .1.3.6.1.6.3.1.1.5.3.0.33 Normal "General event" 192.168.111.10 - general "linkDown:teststring000"
        3015:20190715:092533.404 unmatched trap received from "192.168.111.10": 15.07.2019 09:25:27 .1.3.6.1.4.1.8072.2.3.0.1 Normal "General event" 192.168.111.10 - general "netSnmpExampleHeartbeatRate:123456"
      Now I see them as "unmatched" traps in log.
      But snmptrap.fallback for zabbix host is still empty.

      This is strange, because snmptrap.fallback works for other hosts just fine. Only for zabbix host this doesn't work, when I send a test trap.

      Comment

      • Vaku
        Junior Member
        • Feb 2018
        • 24

        #4
        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.

        Comment

        Working...