zabbix_export: version: '5.4' date: '2021-11-21T22:04:57Z' groups: - uuid: e0242822f07b4633a283b8dc935d3dd9 name: Templates_Created templates: - uuid: 176f494870f94897b6482757238e530e template: 'Cisco BGP SNMP' name: 'Cisco BGP SNMP' description: | ## Description Template Cisco BGP Sessions -AdminStatus -Established Time -OperationStatus -AS Name -Maximum Prefix -Accepted Prefix -BGP last Error By: Flavio Gomes Figueira Camacho Junior Require: ValueMaps .BGP4-MIB::bgpPeerAdminStatus .BGP4-MIB::bgpPeerState ExternalScript .as.name .oid_to_ipv6 Base: CISCO-BGP4-MIB.mib http://www.circitor.fr/Mibs/Html/C/CISCO-BGP4-MIB.php#cbgpPeer2RemoteAs External Scripts and Value Mapping on my Github: https://github.com/flaviojunior1995/Zabbix-Templates ## Overview Template Cisco BGP Sessions -AdminStatus -Established Time -OperationStatus -AS Name -Maximum Prefix -Accepted Prefix -BGP last Error By: Flavio Gomes Figueira Camacho Junior Require: ValueMaps .BGP4-MIB::bgpPeerAdminStatus .BGP4-MIB::bgpPeerState ExternalScript .as.name .oid\_to\_ipv6 Base: CISCO-BGP4-MIB.mib http://www.circitor.fr/Mibs/Html/C/CISCO-BGP4-MIB.php#cbgpPeer2RemoteAs External Scripts and Value Mapping on my Github: https://github.com/flaviojunior1995/Zabbix-Templates groups: - name: Templates_Created discovery_rules: - uuid: 23c6655186204924a4235662dc2aa3ee name: 'BGPv6 Peers Discovery' type: SNMP_AGENT snmp_oid: 'discovery[{#SNMPVALUE},.1.3.6.1.4.1.9.9.187.1.2.5.1.6.2.16,{#SNMPASN},.1.3.6.1.4.1.9.9.187.1.2.5.1.11.2.16]' key: 'cbgpPeer2LocalAddr["BGPv6"]' delay: 1h lifetime: 7d item_prototypes: - uuid: b4a483576d16410b847f1b51fad123a5 name: 'AS Name for IPv6 peer "$2" ASN "$1"' type: EXTERNAL key: 'as_name["{#SNMPASN}","{#SNMPINDEX}","BGPv6"]' delay: 1d history: 7d trends: '0' value_type: CHAR tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' - uuid: 5e00f8dea22e44dfa295d4fd18b948d6 name: 'Administrative status for peer "$1" ASN "$2"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.4.2.16.{#SNMPINDEX}' key: 'cbgp6Peer2AdminStatus["{#SNMPINDEX}","{#SNMPASN}"]' delay: 10m history: 30d trends: '0' valuemap: name: 'BGP4-MIB::bgpPeerAdminStatus' tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' - uuid: 141260a6fbc34f39a28dba277435501b name: 'Established time for peer "$1" ASN "$2"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.19.2.16.{#SNMPINDEX}' key: 'cbgp6Peer2FsmEstablishedTime["{#SNMPINDEX}","{#SNMPASN}"]' delay: 10m history: 30d trends: '0' units: uptime tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' trigger_prototypes: - uuid: 336138c49c7845eea36ef5eeab530bd8 expression: 'last(/Cisco BGP SNMP/cbgp6Peer2FsmEstablishedTime["{#SNMPINDEX}","{#SNMPASN}"])<{$PEER_LOW_TIME}' name: 'BGPv6 peer up time low {#SNMPVALUE} ASN {#SNMPASN}' priority: INFO dependencies: - name: 'BGPv6 peer {#SNMPVALUE} ASN {#SNMPASN} is DOWN' expression: 'last(/Cisco BGP SNMP/cbgp6Peer2State["{#SNMPINDEX}","{#SNMPASN}"],#3)<>6 and last(/Cisco BGP SNMP/cbgp6Peer2AdminStatus["{#SNMPINDEX}","{#SNMPASN}"])=2' - uuid: a89a2fe2481543478167c6eacb143b95 name: 'Remote AS for peer "$1" ASN "$2"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.11.2.16.{#SNMPINDEX}' key: 'cbgp6Peer2RemoteAs["{#SNMPINDEX}","{#SNMPASN}"]' delay: 1d history: 7d trends: '0' tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' - uuid: 0f5ce3d1fb4945bdb74cc8260d81adfa name: 'Operational status for peer "$1" ASN "$2"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.3.2.16.{#SNMPINDEX}' key: 'cbgp6Peer2State["{#SNMPINDEX}","{#SNMPASN}"]' history: 30d trends: '0' valuemap: name: 'BGP4-MIB::bgpPeerState' tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' - uuid: 5b45c267f3834e9bb3d2379eac7d799b name: 'BGP peer last error "$1" ASN "$2"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.17.2.16.{#SNMPINDEX}' key: 'cbgpPeer2LastError["{#SNMPINDEX}","{#SNMPASN}"]' delay: 10m history: 30d trends: '0' value_type: CHAR preprocessing: - type: JAVASCRIPT parameters: - | value = (value.replace(/\s+/g, '')); if (value === "0000") { return "NO last error" } if (value === "0100") { return "Message Header Error - Unspecific" } if (value === "0101") { return "Message Header Error - Connection Not Synchronized" } if (value === "0102") { return "Message Header Error - Bad Message Length" } if (value === "0103") { return "Message Header Error - Bad Message Type" } if (value === "0200") { return "OPEN Message Error - Unspecific" } if (value === "0201") { return "OPEN Message Error - Unsupported Version Number" } if (value === "0202") { return "OPEN Message Error - Bad Peer AS" } if (value === "0203") { return "OPEN Message Error - Bad BGP Identifier" } if (value === "0204") { return "OPEN Message Error - Unsupported Optional Parameter" } if (value === "0205") { return "OPEN Message Error - [Deprecated]" } if (value === "0206") { return "OPEN Message Error - Unacceptable Hold Time" } if (value === "0207") { return "OPEN Message Error - Unsupported Capability"; } if (value === "0208") { return "OPEN Message Error - Role Mismatch (Expire on 2021-03-29)" } if (value === "0300") { return "UPDATE Message Error - Unspecific" } if (value === "0301") { return "UPDATE Message Error - Malformed Attribute List" } if (value === "0302") { return "UPDATE Message Error - Unrecognized Well-known Attibute" } if (value === "0303") { return "UPDATE Message Error - Missing Well-know Attribute" } if (value === "0304") { return "UPDATE Message Error - Attribute Flags Error" } if (value === "0305") { return "UPDATE Message Error - Attribute Length Error" } if (value === "0306") { return "UPDATE Message Error - Invalid ORIGIN Attribute" } if (value === "0307") { return "UPDATE Message Error - [Deprecated]" } if (value === "0308") { return "UPDATE Message Error - Invalid NEXT_HOP Attribute" } if (value === "0309") { return "UPDATE Message Error - Optional Attribute Error" } if (value === "0310") { return "UPDATE Message Error - Invalid Network Field" } if (value === "0311") { return "UPDATE Message Error - Malformed AS_PATH" } if (value === "0400") { return "Hold Timer Expired" } if (value === "0500") { return "Finite State Machine Error - Unspecified Error" } if (value === "0501") { return "Finite State Machine Error - Receive Unexpected Message in OpenSent State" } if (value === "0502") { return "Finite State Machine Error - Receive Unexpected Message in OpenConfirm State" } if (value === "0503") { return "Finite State Machine Error - Receive Unexpected Message in Established State" } if (value === "0600") { return "Cease NOTIFICATION - Reserved" } if (value === "0601") { return "Cease NOTIFICATION - Maximum Number of Prefixes Reached" } if (value === "0602") { return "Cease NOTIFICATION - Administrative Shutdown" } if (value === "0603") { return "Cease NOTIFICATION - Peer De-configured" } if (value === "0604") { return "Cease NOTIFICATION - Administrative Reset" } if (value === "0605") { return "Cease NOTIFICATION - Connection Rejected" } if (value === "0606") { return "Cease NOTIFICATION - Other Configuration Change" } if (value === "0607") { return "Cease NOTIFICATION - Connection Collision Resolution" } if (value === "0608") { return "Cease NOTIFICATION - Out of Resources" } if (value === "0609") { return "Cease NOTIFICATION - Hard Reset" } if (value === "0700") { return "ROUTE-REFRESH Message Error - Reserded" } if (value === "0701") { return "ROUTE-REFRESH Message Error - Invalid Message Length" } return value tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' - uuid: a4326d54199a4d1f982ec593f0567ada name: 'Remote IPv6 Peer "$1"' type: EXTERNAL key: 'oid_to_ipv6["{#SNMPINDEX}"]' delay: 1d history: 7d trends: '0' value_type: CHAR tags: - tag: Application value: BGPv6 - tag: Application value: 'BGPv6 {#SNMPINDEX}' trigger_prototypes: - uuid: cd4f97919ea0466ab919968badc6553c expression: 'last(/Cisco BGP SNMP/cbgp6Peer2State["{#SNMPINDEX}","{#SNMPASN}"],#3)<>6 and last(/Cisco BGP SNMP/cbgp6Peer2AdminStatus["{#SNMPINDEX}","{#SNMPASN}"])=2' name: 'BGPv6 peer {#SNMPVALUE} ASN {#SNMPASN} is DOWN' priority: HIGH - uuid: adffa5ae1bbe4c9093d943e74bda5a73 name: 'BGPv4 Peers Discovery' type: SNMP_AGENT snmp_oid: 'discovery[{#SNMPASN},.1.3.6.1.4.1.9.9.187.1.2.5.1.11.1.4]' key: 'cbgpPeer2RemoteAs["BGPv4"]' delay: 1h lifetime: 7d item_prototypes: - uuid: ddf2142ac8b74dba8ad449f248d618cb name: 'AS Name for IPv4 peer "{#SNMPINDEX}"' type: EXTERNAL key: 'as_name["{#SNMPASN}","{#SNMPINDEX}"]' delay: 1d history: 7d trends: '0' value_type: CHAR tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' - uuid: 045c11e82d0448d19f1dbbc52ea72fa9 name: 'Administrative status for peer "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.4.1.4.{#SNMPINDEX}' key: 'cbgpPeer2AdminStatus[{#SNMPINDEX}]' delay: 10m history: 7d trends: '0' valuemap: name: 'BGP4-MIB::bgpPeerAdminStatus' tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' - uuid: e72a2881c7c1486cbd3274682560ee3d name: 'Established time for peer "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.19.1.4.{#SNMPINDEX}' key: 'cbgpPeer2FsmEstablishedTime[{#SNMPINDEX}]' delay: 10m history: 30d trends: '0' units: uptime tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' trigger_prototypes: - uuid: 122f1b0188804fd982248c2a5eb8490b expression: 'last(/Cisco BGP SNMP/cbgpPeer2FsmEstablishedTime[{#SNMPINDEX}])<{$PEER_LOW_TIME}' name: 'BGPv4 peer up time low {#SNMPINDEX} ASN {#SNMPASN}' priority: INFO dependencies: - name: 'BGPv4 peer {#SNMPINDEX} ASN {#SNMPASN} is DOWN' expression: 'last(/Cisco BGP SNMP/cbgpPeer2State[{#SNMPINDEX}],#3)<>6 and last(/Cisco BGP SNMP/cbgpPeer2AdminStatus[{#SNMPINDEX}])=2' - uuid: 1521e2eac2814eb1a33015ef68cf0e9a name: 'Remote AS for peer "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.11.1.4.{#SNMPINDEX}' key: 'cbgpPeer2RemoteAs[{#SNMPINDEX}]' delay: 1d history: 7d trends: '0' tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' - uuid: d5e812f0032c4f7e84de8ed5592d81cb name: 'Operational status for peer "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.5.1.3.1.4.{#SNMPINDEX}' key: 'cbgpPeer2State[{#SNMPINDEX}]' history: 30d trends: '0' valuemap: name: 'BGP4-MIB::bgpPeerState' tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' - uuid: 31b37256ea24454bb75f2d8b934d31ae name: 'BGP peer last error "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.1.1.7.{#SNMPINDEX}' key: 'cbgpPeerLastErrorTxt["{#SNMPINDEX}"]' delay: 10m history: 30d trends: '0' value_type: CHAR tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' - uuid: ef6f2af26e064b8baaf05c045335e5f4 name: 'Accepted prefix for peer "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.1.1.1.{#SNMPINDEX}' key: 'cbgpPeerPrefixAccepted[{#SNMPINDEX}]' delay: 10m history: 7d trends: 180d tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' - uuid: 73c3efc6984d4394b55dd09ac2cfe7a7 name: 'Maximum prefix for peer "$1"' type: SNMP_AGENT snmp_oid: '1.3.6.1.4.1.9.9.187.1.2.1.1.3.{#SNMPINDEX}' key: 'cbgpPeerPrefixLimit[{#SNMPINDEX}]' delay: 1h history: 30d trends: '0' tags: - tag: Application value: BGPv4 - tag: Application value: 'BGPv4 {#SNMPINDEX}' trigger_prototypes: - uuid: 55235a12dbf4410f96b3768b83732160 expression: 'last(/Cisco BGP SNMP/cbgpPeer2State[{#SNMPINDEX}],#3)<>6 and last(/Cisco BGP SNMP/cbgpPeer2AdminStatus[{#SNMPINDEX}])=2' name: 'BGPv4 peer {#SNMPINDEX} ASN {#SNMPASN} is DOWN' priority: HIGH - uuid: 1b729217db8945169700d482907b5ed8 expression: '( last(/Cisco BGP SNMP/cbgpPeerPrefixAccepted[{#SNMPINDEX}]) * 100 / last(/Cisco BGP SNMP/cbgpPeerPrefixLimit[{#SNMPINDEX}]) ) > {$MAXIMUM_PREFIX_ALARM}' name: 'BGPv4 Prefix Limit {#SNMPINDEX} ASN {#SNMPASN} near' priority: WARNING graph_prototypes: - uuid: 966ec570b20c43f8a76317c2d029c254 name: 'BGP Prefix Accepted {#SNMPINDEX}' ymin_type_1: FIXED graph_items: - drawtype: BOLD_LINE color: FF0000 item: host: 'Cisco BGP SNMP' key: 'cbgpPeerPrefixLimit[{#SNMPINDEX}]' - sortorder: '1' color: 00FF00 item: host: 'Cisco BGP SNMP' key: 'cbgpPeerPrefixAccepted[{#SNMPINDEX}]' macros: - macro: '{$MAXIMUM_PREFIX_ALARM}' value: '80' description: '% maximum prefix limit alarm to reach 100%' - macro: '{$PEER_LOW_TIME}' value: '14400' description: 'time in sec alarm for uptime bgp session' dashboards: - uuid: 174c894f2c5f478c932de6622e3ce15e name: 'Screen BGPv4' pages: - widgets: - type: GRAPH_PROTOTYPE width: '24' height: '5' fields: - type: INTEGER name: source_type value: '2' - type: INTEGER name: columns value: '1' - type: INTEGER name: rows value: '1' - type: GRAPH_PROTOTYPE name: graphid value: name: 'BGP Prefix Accepted {#SNMPINDEX}' host: 'Cisco BGP SNMP' valuemaps: - uuid: af8bc40b831a47c583234758c694d2d5 name: 'BGP4-MIB::bgpPeerAdminStatus' mappings: - value: '1' newvalue: stoped - value: '2' newvalue: started - uuid: 0995ef1b8def4ef9bc4d8df692ed1062 name: 'BGP4-MIB::bgpPeerState' mappings: - value: '1' newvalue: idle - value: '2' newvalue: connect - value: '3' newvalue: active - value: '4' newvalue: opensent - value: '5' newvalue: openconfirm - value: '6' newvalue: established