Ad Widget

Collapse

host interface ip/dns for snmp trap

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nttscao
    Junior Member
    • Jul 2022
    • 4

    #1

    host interface ip/dns for snmp trap

    just set up snmp traps (Zabbix 5.2.0), everything is ok, but it looks like the host interface has to be IP address, dns does not work, when I use IP address, the traps show up in Zabbix, but will not show up after switch to dns, the log shows "unmatched trap received from" message, when I switch back to IP address, it works again, may be I missed some config settings?
  • nttscao
    Junior Member
    • Jul 2022
    • 4

    #2
    can anyone share experiences on setting up snmptraps? especially on choosing host interfaces - IP address vs DNS name,

    Comment

    • dimir
      Zabbix developer
      • Apr 2011
      • 1080

      #3
      Are you sure the DNS name you set in the interface configuration form resolves to the IP that sends the traps to Zabbix?

      Comment

      • nttscao
        Junior Member
        • Jul 2022
        • 4

        #4
        I have both ip and dns configured and switch between them, all other SNMP pulling are working correctly with either ip or dns, below loggings show snmptrapd is receiving traps (#1 and #3), but "unmatched trap" in logging (#2) when zabbix failed to process the trap with dns selected,

        Aug 16 18:57:14 zabbix2.test.dllstx09.us.to.gin.ntt.net snmptrapd[8785]: 2022-08-16 18:57:14 129.250.81.157(via UDP: [129.250.81.157]:33079->[204.2.140.14]:162) TRAP, SNMP v1, community public
        PowerNet-MIB::apc Enterprise Specific Trap (PowerNet-MIB::apcTestTrap) Uptime: 26 days, 22:08:52.80
        DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (232613280) 26 days, 22:08:52.80
        SNMPv2-MIB::snmpTrapOID.0 = OID: PowerNet-MIB::apcTestTrap

        Aug 16 18:57:15 zabbix2.test.dllstx09.us.to.gin.ntt.net zabbix_server[428]: unmatched trap received from "129.250.81.157": 18:57:14 2022/08/16 PDU INFO:
        transactionid 3186
        messageid 0
        receivedfrom UDP: [129.250.81.157]:33079->[204.2.140.14]:162
        community public
        requestid 0
        notificationtype TRAP
        errorindex 0
        errorstatus 0
        version 0
        VARBINDS:
        DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (232613280) 26 days, 22:08:52.80
        SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: PowerNet-MIB::apcTestTrap
        DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (232613280) 26 days, 22:08:52.80
        SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: PowerNet-MIB::apcTestTrap
        SNMP-COMMUNITY-MIB::snmpTrapAddress.0 type=64 value=IpAddress: 129.250.81.157
        SNMP-COMMUNITY-MIB::snmpTrapCommunity.0 type=4 value=STRING: "public"
        SNMPv2-MIB::snmpTrapEnterprise.0 type=6 value=OID: PowerNet-MIB::apc

        Aug 16 20:19:17 zabbix2.test.dllstx09.us.to.gin.ntt.net snmptrapd[8785]: 2022-08-16 20:19:17 129.250.81.157(via UDP: [129.250.81.157]:33960->[204.2.140.14]:162) TRAP, SNMP v1, community public
        PowerNet-MIB::apc Enterprise Specific Trap (PowerNet-MIB::apcTestTrap) Uptime: 26 days, 23:30:56.40
        DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (233105640) 26 days, 23:30:56.40
        SNMPv2-MIB::snmpTrapOID.0 = OID: PowerNet-MIB::apcTestTrap

        thanks!

        Comment

        • Alagie Jammeh
          Junior Member
          • Aug 2022
          • 2

          #5
          get value from agent failed cannot connect to ip 10050 4 interrupted system call

          Comment

          • nttscao
            Junior Member
            • Jul 2022
            • 4

            #6
            I'd appreciate any one uses SNMPTRAP can share their experiences on using IP address vs DNS name,

            Comment

            • Peter Franca
              Junior Member
              • Aug 2018
              • 9

              #7
              Having the same issue. Zabbix only logging traps if I use ip instead of a dns interface.

              Comment

              • doffy
                Junior Member
                • Jan 2019
                • 1

                #8
                Same situation experienced if in host SNMP interface used DNS name. Work fine with IP address.

                Comment

                • ITOMDave
                  Member
                  • Nov 2018
                  • 53

                  #9
                  Hi all,
                  Although I don't have a fix for this (and I have the same problem), I *might* have a reason for it.....

                  The incoming trap doesn't have the DNS name (FQDN) of the host :

                  Code:
                  receivedfrom UDP: [129.250.81.157]:33079->[204.2.140.14]:162
                  If you changed the SNMP host interface definition to "129.250.81.157" then there would be a match in Zabbix and it would work.

                  This of course would cause problems if the DNS name is actually a dynamic DNS service and the IP Address changes regularly.

                  I wonder, can snmptrapd be configured to translate source IP Addresses to FQDN's - i.e. do the equivalent of an nslookup on the receivedfrom IP address ? I'll go and have a look around.

                  Dave.

                  Comment

                  • Markku
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
                    • Sep 2018
                    • 1781

                    #10
                    Originally posted by ITOMDave
                    I wonder, can snmptrapd be configured to translate source IP Addresses to FQDN's - i.e. do the equivalent of an nslookup on the receivedfrom IP address ? I'll go and have a look around.
                    You can at least modify the trap receiver Perl script (https://git.zabbix.com/projects/ZBX/...ap_receiver.pl) to do a reverse lookup for the IP if you want.

                    Markku

                    Comment

                    Working...