Skip to content
Permalink
main
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>4.4</version>
<date>2020-12-29T17:55:04Z</date>
<groups>
<group>
<name>Templates_Created</name>
</group>
</groups>
<templates>
<template>
<template>Template BGPv4 SNMP</template>
<name>Template BGPv4 SNMP</name>
<description>Template BGPv4 Sessions&#13;
-Admin Status&#13;
-Established Time&#13;
-Operation Status&#13;
-AS Name&#13;
-BGP last Error&#13;
&#13;
By: Flavio Gomes Figueira Camacho Junior&#13;
&#13;
Require:&#13;
ValueMaps&#13;
.BGP4-MIB::bgpPeerAdminStatus&#13;
.BGP4-MIB::bgpPeerState&#13;
&#13;
ExternalScript&#13;
.as_name&#13;
&#13;
Base: &#13;
BGP4-MIB.mib&#13;
https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml&#13;
&#13;
External Scripts and Value Mapping on my Github:&#13;
https://github.com/flaviojunior1995/Zabbix-Templates</description>
<groups>
<group>
<name>Templates_Created</name>
</group>
</groups>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<discovery_rules>
<discovery_rule>
<name>BGPv4 Peers Discovery</name>
<type>SNMPV2</type>
<snmp_community>{$SNMP_COMMUNITY}</snmp_community>
<snmp_oid>discovery[{#SNMPVALUE},.1.3.6.1.2.1.15.3.1.7,{#SNMPASN},.1.3.6.1.2.1.15.3.1.9]</snmp_oid>
<key>BgpPeerDiscovery[&quot;BGPv4&quot;]</key>
<delay>1h</delay>
<lifetime>7d</lifetime>
<item_prototypes>
<item_prototype>
<name>AS Name for IPv4 peer &quot;$1&quot;</name>
<type>EXTERNAL</type>
<key>as_name[&quot;{#SNMPASN}&quot;,&quot;{#SNMPVALUE}&quot;]</key>
<delay>1d</delay>
<history>7d</history>
<trends>0</trends>
<value_type>CHAR</value_type>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<application_prototypes>
<application_prototype>
<name>BGPv4 {#SNMPVALUE}</name>
</application_prototype>
</application_prototypes>
</item_prototype>
<item_prototype>
<name>Administrative status for peer &quot;$1&quot;</name>
<type>SNMPV2</type>
<snmp_community>{$SNMP_COMMUNITY}</snmp_community>
<snmp_oid>1.3.6.1.2.1.15.3.1.3.{#SNMPVALUE}</snmp_oid>
<key>bgpPeerAdminStatus[&quot;{#SNMPVALUE}&quot;]</key>
<delay>10m</delay>
<history>7d</history>
<trends>0</trends>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<application_prototypes>
<application_prototype>
<name>BGPv4 {#SNMPVALUE}</name>
</application_prototype>
</application_prototypes>
<valuemap>
<name>BGP4-MIB::bgpPeerAdminStatus</name>
</valuemap>
</item_prototype>
<item_prototype>
<name>Established time for peer &quot;$1&quot;</name>
<type>SNMPV2</type>
<snmp_community>{$SNMP_COMMUNITY}</snmp_community>
<snmp_oid>1.3.6.1.2.1.15.3.1.16.{#SNMPVALUE}</snmp_oid>
<key>bgpPeerFsmEstablishedTime[&quot;{#SNMPVALUE}&quot;]</key>
<delay>10m</delay>
<history>30d</history>
<trends>0</trends>
<units>uptime</units>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<application_prototypes>
<application_prototype>
<name>BGPv4 {#SNMPVALUE}</name>
</application_prototype>
</application_prototypes>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}&lt;{$PEER_LOW_TIME}</expression>
<name>BGP peer up time low &quot;{#SNMPVALUE}&quot; ASN &quot;{#SNMPASN}&quot;</name>
<priority>INFO</priority>
<dependencies>
<dependency>
<name>BGP peer &quot;{#SNMPVALUE}&quot; ASN &quot;{#SNMPASN}&quot; is DOWN</name>
<expression>{Template BGPv4 SNMP:bgpPeerState[&quot;{#SNMPVALUE}&quot;].last(#3)}&lt;&gt;6 and {Template BGPv4 SNMP:bgpPeerAdminStatus[&quot;{#SNMPVALUE}&quot;].last(0)}=2</expression>
</dependency>
</dependencies>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>BGP peer last error &quot;$1&quot;</name>
<type>SNMPV2</type>
<snmp_community>{$SNMP_COMMUNITY}</snmp_community>
<snmp_oid>1.3.6.1.2.1.15.3.1.14.{#SNMPVALUE}</snmp_oid>
<key>bgpPeerLastError[&quot;{#SNMPVALUE}&quot;]</key>
<delay>10m</delay>
<history>30d</history>
<trends>0</trends>
<value_type>CHAR</value_type>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<application_prototypes>
<application_prototype>
<name>BGPv4 {#SNMPVALUE}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JAVASCRIPT</type>
<params>value = (value.replace(/\s+/g, ''));
if (value === &quot;0000&quot;) {
return &quot;NO last error&quot;
}
if (value === &quot;0100&quot;) {
return &quot;Message Header Error - Unspecific&quot;
}
if (value === &quot;0101&quot;) {
return &quot;Message Header Error - Connection Not Synchronized&quot;
}
if (value === &quot;0102&quot;) {
return &quot;Message Header Error - Bad Message Length&quot;
}
if (value === &quot;0103&quot;) {
return &quot;Message Header Error - Bad Message Type&quot;
}
if (value === &quot;0200&quot;) {
return &quot;OPEN Message Error - Unspecific&quot;
}
if (value === &quot;0201&quot;) {
return &quot;OPEN Message Error - Unsupported Version Number&quot;
}
if (value === &quot;0202&quot;) {
return &quot;OPEN Message Error - Bad Peer AS&quot;
}
if (value === &quot;0203&quot;) {
return &quot;OPEN Message Error - Bad BGP Identifier&quot;
}
if (value === &quot;0204&quot;) {
return &quot;OPEN Message Error - Unsupported Optional Parameter&quot;
}
if (value === &quot;0205&quot;) {
return &quot;OPEN Message Error - [Deprecated]&quot;
}
if (value === &quot;0206&quot;) {
return &quot;OPEN Message Error - Unacceptable Hold Time&quot;
}
if (value === &quot;0207&quot;) {
return &quot;OPEN Message Error - Unsupported Capability&quot;;
}
if (value === &quot;0208&quot;) {
return &quot;OPEN Message Error - Role Mismatch (Expire on 2021-03-29)&quot;
}
if (value === &quot;0300&quot;) {
return &quot;UPDATE Message Error - Unspecific&quot;
}
if (value === &quot;0301&quot;) {
return &quot;UPDATE Message Error - Malformed Attribute List&quot;
}
if (value === &quot;0302&quot;) {
return &quot;UPDATE Message Error - Unrecognized Well-known Attibute&quot;
}
if (value === &quot;0303&quot;) {
return &quot;UPDATE Message Error - Missing Well-know Attribute&quot;
}
if (value === &quot;0304&quot;) {
return &quot;UPDATE Message Error - Attribute Flags Error&quot;
}
if (value === &quot;0305&quot;) {
return &quot;UPDATE Message Error - Attribute Length Error&quot;
}
if (value === &quot;0306&quot;) {
return &quot;UPDATE Message Error - Invalid ORIGIN Attribute&quot;
}
if (value === &quot;0307&quot;) {
return &quot;UPDATE Message Error - [Deprecated]&quot;
}
if (value === &quot;0308&quot;) {
return &quot;UPDATE Message Error - Invalid NEXT_HOP Attribute&quot;
}
if (value === &quot;0309&quot;) {
return &quot;UPDATE Message Error - Optional Attribute Error&quot;
}
if (value === &quot;0310&quot;) {
return &quot;UPDATE Message Error - Invalid Network Field&quot;
}
if (value === &quot;0311&quot;) {
return &quot;UPDATE Message Error - Malformed AS_PATH&quot;
}
if (value === &quot;0400&quot;) {
return &quot;Hold Timer Expired&quot;
}
if (value === &quot;0500&quot;) {
return &quot;Finite State Machine Error - Unspecified Error&quot;
}
if (value === &quot;0501&quot;) {
return &quot;Finite State Machine Error - Receive Unexpected Message in OpenSent State&quot;
}
if (value === &quot;0502&quot;) {
return &quot;Finite State Machine Error - Receive Unexpected Message in OpenConfirm State&quot;
}
if (value === &quot;0503&quot;) {
return &quot;Finite State Machine Error - Receive Unexpected Message in Established State&quot;
}
if (value === &quot;0600&quot;) {
return &quot;Cease NOTIFICATION - Reserved&quot;
}
if (value === &quot;0601&quot;) {
return &quot;Cease NOTIFICATION - Maximum Number of Prefixes Reached&quot;
}
if (value === &quot;0602&quot;) {
return &quot;Cease NOTIFICATION - Administrative Shutdown&quot;
}
if (value === &quot;0603&quot;) {
return &quot;Cease NOTIFICATION - Peer De-configured&quot;
}
if (value === &quot;0604&quot;) {
return &quot;Cease NOTIFICATION - Administrative Reset&quot;
}
if (value === &quot;0605&quot;) {
return &quot;Cease NOTIFICATION - Connection Rejected&quot;
}
if (value === &quot;0606&quot;) {
return &quot;Cease NOTIFICATION - Other Configuration Change&quot;
}
if (value === &quot;0607&quot;) {
return &quot;Cease NOTIFICATION - Connection Collision Resolution&quot;
}
if (value === &quot;0608&quot;) {
return &quot;Cease NOTIFICATION - Out of Resources&quot;
}
if (value === &quot;0609&quot;) {
return &quot;Cease NOTIFICATION - Hard Reset&quot;
}
if (value === &quot;0700&quot;) {
return &quot;ROUTE-REFRESH Message Error - Reserded&quot;
}
if (value === &quot;0701&quot;) {
return &quot;ROUTE-REFRESH Message Error - Invalid Message Length&quot;
}
return value</params>
</step>
</preprocessing>
</item_prototype>
<item_prototype>
<name>Remote AS for peer &quot;$1&quot;</name>
<type>SNMPV2</type>
<snmp_community>{$SNMP_COMMUNITY}</snmp_community>
<snmp_oid>1.3.6.1.2.1.15.3.1.9.{#SNMPVALUE}</snmp_oid>
<key>bgpPeerRemoteAs[&quot;{#SNMPVALUE}&quot;]</key>
<delay>1d</delay>
<history>7d</history>
<trends>0</trends>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<application_prototypes>
<application_prototype>
<name>BGPv4 {#SNMPVALUE}</name>
</application_prototype>
</application_prototypes>
</item_prototype>
<item_prototype>
<name>Operational status for peer &quot;$1&quot;</name>
<type>SNMPV2</type>
<snmp_community>{$SNMP_COMMUNITY}</snmp_community>
<snmp_oid>1.3.6.1.2.1.15.3.1.2.{#SNMPVALUE}</snmp_oid>
<key>bgpPeerState[&quot;{#SNMPVALUE}&quot;]</key>
<history>30d</history>
<trends>0</trends>
<applications>
<application>
<name>BGPv4</name>
</application>
</applications>
<application_prototypes>
<application_prototype>
<name>BGPv4 {#SNMPVALUE}</name>
</application_prototype>
</application_prototypes>
<valuemap>
<name>BGP4-MIB::bgpPeerState</name>
</valuemap>
</item_prototype>
</item_prototypes>
<trigger_prototypes>
<trigger_prototype>
<expression>{Template BGPv4 SNMP:bgpPeerState[&quot;{#SNMPVALUE}&quot;].last(#3)}&lt;&gt;6 and {Template BGPv4 SNMP:bgpPeerAdminStatus[&quot;{#SNMPVALUE}&quot;].last(0)}=2</expression>
<name>BGP peer &quot;{#SNMPVALUE}&quot; ASN &quot;{#SNMPASN}&quot; is DOWN</name>
<priority>HIGH</priority>
<description>Trigger for peer that has a remote AS matching {$BGP_PEER_AS} macro.</description>
</trigger_prototype>
</trigger_prototypes>
</discovery_rule>
</discovery_rules>
<macros>
<macro>
<macro>{$PEER_LOW_TIME}</macro>
<value>14400</value>
<description>time in sec alarm for low uptime bgp session</description>
</macro>
</macros>
</template>
</templates>
<value_maps>
<value_map>
<name>BGP4-MIB::bgpPeerAdminStatus</name>
<mappings>
<mapping>
<value>1</value>
<newvalue>stoped</newvalue>
</mapping>
<mapping>
<value>2</value>
<newvalue>started</newvalue>
</mapping>
</mappings>
</value_map>
<value_map>
<name>BGP4-MIB::bgpPeerState</name>
<mappings>
<mapping>
<value>1</value>
<newvalue>idle</newvalue>
</mapping>
<mapping>
<value>2</value>
<newvalue>connect</newvalue>
</mapping>
<mapping>
<value>3</value>
<newvalue>active</newvalue>
</mapping>
<mapping>
<value>4</value>
<newvalue>opensent</newvalue>
</mapping>
<mapping>
<value>5</value>
<newvalue>openconfirm</newvalue>
</mapping>
<mapping>
<value>6</value>
<newvalue>established</newvalue>
</mapping>
</mappings>
</value_map>
</value_maps>
</zabbix_export>