
To configure it:Īdd the perl script to snmptrapd configuration file (nf), e.g.: perl do ““ Ĭonfigure the receiver, e.g: $SNMPTrapperFile = ‘‘ $DateTimeFormat = ‘‘ Perl trap receiver (look for misc/snmptrap/zabbix_trap_) can be used to pass traps to Zabbix server directly from snmptrapd. Requirements: Perl, Net-SNMP compiled with -enable-embedded-perl (done by default since Net-SNMP 5.4) * “General event” Normal Configuring Perl trap receiver Unknown traps can be handled by defining a general event in nf: EVENT general. 1.3.6.1.6.3.1.1.5.1 “Status Events” Normal FORMAT ZBXTRAP $aA Device reinitialized (coldStart)ĭo not use unknown traps - Zabbix will not be able to recognize them. Now format the traps for Zabbix to recognize them (edit nf):Įach FORMAT statement should start with “ZBXTRAP ”, where will be compared to IP and DNS addresses of SNMP interfaces on Zabbix. For more information, see the known issues. The “net-snmp-perl” package has been removed in RHEL/CentOS 8.0-8.2 re-added in RHEL 8.3. Set the date-time format: date_time_format = %H:%M:%S %Y/%m/%d = Log traps to the trap file which will be read by Zabbix: log_enable = 1 log_file = When SNMPTT is configured to receive the traps, configure snmptt.ini:Įnable the use of the Perl module from the NET-SNMP package: net_snmp_perl_enable = 1 See instructions for configuring SNMPTT in its homepage: Configuring SNMPTTĪt first, snmptrapd should be configured to use SNMPTT.įor the best performance, SNMPTT should be configured as a daemon using snmptthandler-embedded to pass the traps to it. If systemd parameter PrivateTmp is used, this file is unlikely to work in /tmp. To do that, edit the configuration file ( zabbix_nf or zabbix_nf): To read the traps, Zabbix server or proxy must be configured to start the SNMP trapper process and point to the trap file that is being written by SNMPTT or a perl trap receiver. 2 Setting up SNMP trap monitoring Configuring Zabbix server/proxy

Note that other formats such as ‘Numeric’ are also acceptable but might require a custom trap handler.įor SNMP trap monitoring to work, it must first be correctly set up. Set the Type of information to be ‘Log’ for the timestamps to be parsed. Multi-line regexp matching is not supported at this time. This item is supported since Zabbix 2.0.0. This item can be set only for SNMP interfaces. Note: Starting with Zabbix 2.0.5, user macros and global regular expressions are supported in the parameter of this item key.Ĭatches all SNMP traps that were not caught by any of the snmptrap items for that interface.

If regexp is unspecified, catches any trap. In the Key field use one of the SNMP trap keys: KeyĬatches all SNMP traps that match the regular expression specified in regexp. The address from each received trap is compared to the IP and DNS addresses of all SNMP interfaces to find the corresponding hosts. In Configuration → Hosts, in the Host interface field set an SNMP interface with the correct IP or DNS address. (This is configured by “Log unmatched SNMP traps” in Administration → General → Other.)Ĭonfiguring the following fields in the frontend is specific for this item type: If the trap was not set as the value of any item, Zabbix by default logs the unmatched trap. If no matching item is found and there is an “snmptrap.fallback” item, the trap is set as the value of that. The trap is set as the value of all matched items. Note that only the selected “IP” or “DNS” in host interface is used during the matching.įor each found item, the trap is compared to regexp in “snmptrap”. Zabbix SNMP trapper reads and parses the trap fileįor each trap Zabbix finds all “SNMP trapper” items with host interfaces matching the received trap address. SNMPTT or Perl trap receiver parses, formats and writes the trap to a file Snmptrapd passes the trap to SNMPTT or calls Perl trap receiver Receiving SNMP traps in Zabbix is designed to work with snmptrapd and one of the built-in mechanisms for passing the traps to Zabbix - either a perl script or SNMPTT. Using traps may detect some short problems that occur amidst the query interval and may be missed by the query data. Usually traps are sent upon some condition change and the agent connects to the server on port 162 (as opposed to port 161 on the agent side that is used for queries). In this case the information is sent from a SNMP-enabled device and is collected or “trapped” by Zabbix.

Receiving SNMP traps is the opposite to querying SNMP-enabled devices.
