thank you for helping me
Ad Widget
Collapse
SNMP traps
Collapse
X
-
I assume you've read the documentation that Hamardaban linked, especially the workflow near the beginning of https://www.zabbix.com/documentation...types/snmptrap
I'm not following what you mean by "snmptrap.log" and "snmptt.log". You want Zabbix and whatever process you're using to parse the traps (apparently you're using SNMPTT?) to agree on the file path. Zabbix (at least Zabbix's SNMP Trapper process) reads the same file that your trap parser writes.
Just as a purely hypothetical example, if you've modified SNMPTT so that it writes its output to the file /var/tmp/ZABBIX_SNMP_TRAPS_ARE_EASY , then you better also be specifying
in your zabbix_serverd.conf (or a file it includes). Reminder that you also must start at least one Zabbix SNMP Trapper process (StartSNMPTrapper=1).Code:SNMPTrapperFile=/var/tmp/ZABBIX_SNMP_TRAPS_ARE_EASY
Also, wherever you decide to put that file, it needs to be a place that the 'snmptrapd' can write to and a place that the 'zabbix' user (or group) can read from.
If you use /tmp on modern systems, beware systemd's PrivateTmp can cause some confusion about where the file actually ends up.
Comment
-
In my zabbix.server.conf I have put the below path
HTML Code:### Option: SNMPTrapperFile # Temporary file used for passing data from SNMP trap daemon to the server. # Must be the same as in zabbix_trap_receiver.pl or SNMPTT configuration file. # # Mandatory: no # Default: # SNMPTrapperFile=/tmp/zabbix_traps.tmp StartSNMPTrapper=1 SNMPTrapperFile=/var/log/zabbix/snmptrap.log
Where do I declare the same path at snmptt.ini ?
at the snmptrapd.conf I have the below
HTML Code:# Example configuration file for snmptrapd # # No traps are handled by default, you must edit this file! # authCommunity log,execute public authCommunity log,execute something traphandle default snmptt
Comment
-
this is what I have now
zabbix_server.conf
smptt.iniHTML Code:### Option: SNMPTrapperFile # Temporary file used for passing data from SNMP trap daemon to the server. # Must be the same as in zabbix_trap_receiver.pl or SNMPTT configuration file. # # Mandatory: no # Default: # SNMPTrapperFile=/tmp/zabbix_traps.tmp StartSNMPTrapper=1 SNMPTrapperFile=/var/log/zabbix/snmptrap.log #SNMPTrapperFile=/var/log/snmptt/snmptt.log
snmptrapd.confHTML Code:# Set to 1 to enable text logging of *TRAPS*. Make sure you specify a log_file # location log_enable = 1 # Log file location. The COMPLETE path and filename. Ex: '/var/log/snmptt/snmptt.log' #log_file = /var/log/snmptt/snmptt.log log_file =/var/log/zabbix/snmptrap.log
HTML Code:# Example configuration file for snmptrapd # # No traps are handled by default, you must edit this file! # authCommunity log,execute public authCommunity log,execute something traphandle default snmptt
in my /var/log/zabbix/snmptrap.log I can see traps
10:58:16 2020/09/08 = [DATE TIME FORMAT] BGP4-MIB::bgpBackwardTransition Normal "General event" UNKNOWN - ZBXTRAP 10.10.4.40 general BGP4-MIB::bgpPeerLastError.IP:04 00 BGP4-MIB::bgpPeerState.IP:idle
I have configured also the itemsand I still cannot see all these traps at GUI Monitoring -> ProblemsSNMP_Trap_regex & SNMP traps (fallback)
Comment
-
First make sure that you see incoming traps in the latest data at the items that you have configured.
If you don't see any data and are sure that there were traps, check that the flag “Log unmatched SNMP traps” in Administration → General → Other is set.
Also look in the server log - there may be lines related to receiving traps.Comment
-
Well if you only did this, then you have some confusion about zabbix basics I think, quick reviewthis is what I have now
in my /var/log/zabbix/snmptrap.log I can see traps
10:58:16 2020/09/08 = [DATE TIME FORMAT] BGP4-MIB::bgpBackwardTransition Normal "General event" UNKNOWN - ZBXTRAP 10.10.4.40 general BGP4-MIB::bgpPeerLastError.IP:04 00 BGP4-MIB::bgpPeerState.IP:idle
I have configured also the itemsand I still cannot see all these traps at GUI Monitoring -> ProblemsSNMP_Trap_regex & SNMP traps (fallback) - Traps = your source of data (Your router)
- Snmptt + handler = the gathers of data (Zabbix server/proxy process)
- Item of "SNMP Trap regex" type = Filter a meaningful bunch of group data (Your zabbix item regex based on bgpBackwardTransition)
- Now you need a trigger that verifies if the item is in a state of failing to be a problem event. (As an example let's say that bgpBackwardTransition "Fail" is the Trigger Expression and the bgpBackwardTransition "Normal" is the Recovery Expression, then you're gonna make a .str() that matches what you want to generate a problem event.)
Comment
Comment