Ad Widget

Collapse

SNMP trap with cisco routers and switches

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Murod
    Junior Member
    • Aug 2019
    • 3

    #1

    SNMP trap with cisco routers and switches

    Hi everyone!
    I have zabbix and i have 50 routers. I connected it SNMPv2 but i want to get full information with my routers so i need to configure snmp trap and connect it with my routers.
    I installed it but i can not see my routers via snmptrap
    What should i do?
    Has anyone configured snmptrap with cisco router or switch?
    Please share with me your opinion
  • Murod
    Junior Member
    • Aug 2019
    • 3

    #2
    Hi all!
    I've been trying to configure my zabbix server to be able to receive snmptraps.

    By the moment, i've managed to receive the traps into my computer but zabbix still isn't able to handle them.
    Could anyone tell me how can i make my zabbix show me the traps, please???

    I'm going crazy!!

    Comment

    • lukaszor
      Junior Member
      • Jun 2018
      • 17

      #3
      Hi. First of all, have You configured required snmp traps on Your Cisco device? For example on switch You could do something like:

      snmp-server community TEST_NAME RO
      snmp-server enable traps syslog
      snmp-server host 10.0.0.1 version 2c TEST_NAME

      Than , have You created in zabbix host, and have You set the item for snmp traps?
      You have to set Key: snmptrap.fallback

      Make sure Your zabbix server config file has value set like:

      StartSNMPTrapper=1

      And trap file like:

      SNMPTrapperFile=/tmp/zabbix_traps.tmp

      There is alot info online how to set it up.

      The idea of receiving snmp trap is as folows:

      The workflow of receiving a trap:

      snmptrapd receives a trap
      snmptrapd passes the trap to SNMPTT or calls Perl trap receiver
      SNMPTT or Perl trap receiver parses, formats and writes the trap to a file
      Zabbix SNMP trapper reads and parses the trap file
      For each trap Zabbix finds all “SNMP trapper” items with host interfaces matching the received trap address. Note that only the selected “IP” or “DNS” in host interface is used during the matching.
      For each found item, the trap is compared to regexp in “snmptrap[regexp]”. The trap is set as the value of all matched items. If no matching item is found and there is an “snmptrap.fallback” item, the trap is set as the value of that.
      If the trap was not set as the value of any item, Zabbix by default logs the unmatched trap. (This is configured by “Log unmatched SNMP traps” in Administration ? General ? Other.)

      Good luck!

      Comment


      • Murod
        Murod commented
        Editing a comment
        Hi !
        Thank you for your attention.
        I have already done like that https://zabbix.org/wiki/Start_with_SNMP_traps_in_Zabbix
        and i connected it with snmptt
        i debugged cisco router there and there were traffics with zabbix server.
        but i could not see it in graphic and zabbix log

        If you have completely config snmptrap snmptt please share it with me
    • Murod
      Junior Member
      • Aug 2019
      • 3

      #4
      I did like that
      Attached Files

      Comment

      • lukaszor
        Junior Member
        • Jun 2018
        • 17

        #5
        Hi. My snmptrapd.conf looks like this:

        Code:
        zabbix@zabbix:~$ cat /etc/snmp/snmptrapd.conf
        
        #
        # EXAMPLE-trap.conf:
        #   An example configuration file for configuring the Net-SNMP snmptrapd agent.
        #
        ###############################################################################
        #
        # This file is intended to only be an example.
        # When the snmptrapd agent starts up, this is where it will look for it.
        #
        # All lines beginning with a '#' are comments and are intended for you
        # to read.  All other lines are configuration commands for the agent.
        
        #
        # PLEASE: read the snmptrapd.conf(5) manual page as well!
        #
        #authCommunity log,execute,net privateЦ──
        #authCommunity log,execute,net public
        #
        ## send mail when get any events
        #traphandle default /usr/bin/traptoemail -s smtp.example.org [email protected]
        #
        ## send mail when get linkDown
        #traphandle .1.3.6.1.6.3.1..5.3 /usr/bin/traptoemail -s smtp.example.org [email protected]
        
        #traphandle default /usr/sbin/snmptthandler
        authCommunity execute Zabbix
        perl do "/usr/bin/zabbix_trap_receiver.pl";
        And my snmptt.conf all it has is:

        Code:
        #
        EVENT general .* "General event" Normal
        FORMAT ZBXTRAP $aA $ar

        Comment

        • lukaszor
          Junior Member
          • Jun 2018
          • 17

          #6
          And make sure You have created item for catching snmptrap like on the picture attached
          Attached Files

          Comment


          • Murod
            Murod commented
            Editing a comment
            Thanks bro!
            I will try
        • Williams Castillo
          Junior Member
          • Aug 2019
          • 7

          #7
          Bonjour,
          Murod a tu réussi?

          Comment

          Working...