Ad Widget

Collapse

SNMP Trap Cisco BGP - zabbix 3.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicram
    Junior Member
    • Feb 2020
    • 2

    #1

    SNMP Trap Cisco BGP - zabbix 3.4

    Hello,
    I have problem to run snmp traps for bgp sessions.
    I use this template https://share.zabbix.com/network_dev...-cisco-asr1006.
    In trap I have:
    Code:
    key = snmptrap["(bgpEstablished|bgpBackwardTransition|cbgpFsmStateChange).*bgpPeerState\.234.23.12.2[[:space:]][a-zA-Z]+[[:space:]]"]
    Log time format = hh:mm:ss yyyy/MM/dd
    Now on cisco I shutdown and up bgp session to test. In my "/var/log/snmp/snmptrap.log" perl script prints:
    Code:
    21:58:03 2020/02/16 ZBXTRAP 192.168.113.101
    PDU INFO:
      requestid                      9135
      messageid                      0
      errorstatus                    0
      version                        1
      notificationtype               TRAP
      transactionid                  20
      errorindex                     0
      community                      ZabbixTRAP
      receivedfrom                   UDP: [192.168.113.101]:51285->[172.21.7.10]:162
    VARBINDS:
      DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (30039730) 3 days, 11:26:37.30
      SNMPv2-MIB::snmpTrapOID.0      type=6  value=OID: BGP4-MIB::bgpEstablished
      BGP4-MIB::bgpPeerLastError.234.23.12.2 type=4  value=Hex-STRING: 06 02 
      BGP4-MIB::bgpPeerState.234.23.12.2 type=2  value=INTEGER: 6
    But history of this item is clean. I have also created "snmptrap.fallback" and bgp traps has not been printed in this item but in fallback I can see ospf traps.

    I was doing with this documentation https://www.zabbix.com/documentation...types/snmptrap
    Why bgp traps aren't recognized?
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    You don't get any data because the regular expression specified in the key doesn't match the received data. You can check on the website https://regex101.com/

    For example, this expression
    Code:
    (bgpEstablished|bgpBackwardTransition|cbgpFsmStateChange)[[[:space:]]|.]*bgpPeerState\.234\.23\.12\.2\s+[a-zA-Z=\s\d]+:\s+(\d+)
    will extract the last digit =6 (as group \2) in the line BGP4-MIB::bgpPeerState.234.23.12.2 type=2 value=INTEGER: 6

    Comment

    • nicram
      Junior Member
      • Feb 2020
      • 2

      #3
      Thank you for support.
      So, the template has error.

      Comment

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

        #4
        It is not quite correct to say that there is an error in the template. A lot depends on the snmptt settings , and there may be firmware versions on cisco... It seems to me that you need to treat templates as a framework on the basis of which you need to build your monitoring.

        Comment

        Working...