Ad Widget

Collapse

SNMP traps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manosnms
    Member
    • Jun 2020
    • 52

    #16
    thank you for helping me

    Comment

    • manosnms
      Member
      • Jun 2020
      • 52

      #17
      .............................
      Last edited by manosnms; 07-09-2020, 17:38.

      Comment

      • manosnms
        Member
        • Jun 2020
        • 52

        #18
        Its not clear to me yet how zabbix(in my case the snmptrap.log) is getting the traps from snmptt (i suppose from the snmptt.log)

        Comment

        • tim.mooney
          Senior Member
          • Dec 2012
          • 1427

          #19
          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

          Code:
          SNMPTrapperFile=/var/tmp/ZABBIX_SNMP_TRAPS_ARE_EASY
          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).

          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

          • manosnms
            Member
            • Jun 2020
            • 52

            #20
            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

            • manosnms
              Member
              • Jun 2020
              • 52

              #21
              this is what I have now

              zabbix_server.conf
              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
              #SNMPTrapperFile=/var/log/snmptt/snmptt.log
              smptt.ini
              HTML 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
              snmptrapd.conf
              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 items
              SNMP_Trap_regex & SNMP traps (fallback)
              and I still cannot see all these traps at GUI Monitoring -> Problems

              Comment

              • Hamardaban
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • May 2019
                • 2713

                #22
                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

                • isaqueprofeta
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Aug 2020
                  • 154

                  #23
                  Originally posted by manosnms
                  this 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 items
                  SNMP_Trap_regex & SNMP traps (fallback)
                  and I still cannot see all these traps at GUI Monitoring -> Problems
                  Well if you only did this, then you have some confusion about zabbix basics I think, quick review
                  • 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

                  Working...