GithubHelp home page GithubHelp logo

prototype-x / zabbix-template-juniper-mx-bgp4-ipv4-ipv6 Goto Github PK

View Code? Open in Web Editor NEW
33.0 9.0 23.0 47 KB

Zabbix Template for Juniper MX discovery BGP4 peers ipv4 and ipv6, RE, interfaces

License: GNU General Public License v3.0

Python 100.00%
juniper junos mx zabbix template bgp-peer template-juniper-mx discovery-bgp4-peers zabbix-templates

zabbix-template-juniper-mx-bgp4-ipv4-ipv6's Introduction

Zabbix-Template-Juniper-MX-BGP4-ipv4-ipv6

For BGP peers use the BGP4-V2-MIB-JUNIPER(mib-jnx-bgpmib2.txt), unfortunately ipv4 and ipv6 adresses return as hex numbers. Example ipv4 like: C0 A8 01 01, ipv6 like: 20 01 0D B8 11 A3 09 D7 1F 34 8A 2E 07 A0 76 5D. To fix this use script LLD.py for discovery BGP4 peers.

Used template for BGP: ZBX-CISCO-BGP4

Items BGP

  • Discovery: Administrative status of a peer
  • Discovery: Operational status of a peer
  • Discovery: Established time for a peer
  • Discovery: Remote AS for a peer
  • Discovery: All receiving prefixes for peer
  • Discovery: Accepted receiving prefixes for peer
  • Discovery: Rejected receiving prefixes for peer
  • Discovery: All advertising prefixes for peer
  • Discovery: Last recieved error for peer
  • Discovery: Last sent error for peer

Items RE

  • Discovery: CPU Usage
  • Discovery: 5 min load avarage
  • Discovery: Memory Usage
  • Discovery: Routing Engine temp

Items interfaces

  • Discovery: ifAdminStatus
  • Discovery: ifAlias
  • Discovery: ifHCInOctets
  • Discovery: ifHCOutOctets
  • Discovery: ifInDiscards
  • Discovery: ifInErrors
  • Discovery: ifName
  • Discovery: ifOperStatus
  • Discovery: ifOutDiscards
  • Discovery: ifOutErrors

Items

  • jnxRedAlarmState
  • jnxYellowAlarmState
  • Ping check
  • Uptime

Triggers for BGP, interfaces, RE

  • Loss ping
  • Router restarted
  • Alarm
  • Memory low
  • CPU high usage
  • Temp high
  • Interface down
  • Lost BGP prefixes
  • No BGP prefixes
  • BGP peer down

Graphs

  • BGP prefixes advertise/recieve
  • interfaces load and errors
  • RE load: CPU, Memory, Temp

Screen

  • one

Installation

Without script, IP shown as hex numbers, only Zabbix 3.X.X

  1. Import Template.Juniper.MX.xml file into Zabbix.

  2. Go to: Template Juniper MX - > Discovery rules -> JunOS BGP4

  3. Set type: SNMPv2 agent

  4. Set key: discovery-JunOS-BGP

  5. Set SNMP OID:

     discovery[{#PEERADDR}, .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.11, {#PREFXTBL}, .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.14, {#ADDRTYPE}, .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.10, {#ASNUM}, .1.3.6.1.4.1.2636.5.1.1.2.1.1.1.13]
    
  6. Associate Template Juniper MX to the host.

  7. Add to your host the {$SNMP_COMMUNITY} macro with your SNMP community as value.

  8. Add to your host the {$BGP_PEER_AS} macro with your list BGP peer remote AS as value (ex: ASN1|ASN2|ASN3). These ASs have a high severity triggers.

  9. Go to: Template Juniper MX -> Discovery rules -> JunOS Interfaces -> Filters

  10. Check filter, edit or delete.

With script, IP shown as normal, Zabbix 2.X.X and above

  1. Import Template.Juniper.MX.xml file into Zabbix.(For Zabbix 2.X.X import valuemaps.xml first)

  2. Copy script LLD.py to /usr/lib/zabbix/externalscripts

  3. chmod +x LLD.py

  4. Go to: Template Juniper MX - > Discovery rules -> JunOS BGP4

  5. Set type: external check

  6. Set key:

     LLD.py["-h", {HOST.CONN}, "-c", "{$SNMP_COMMUNITY}", "-mi", "{#PEERADDR}", "-m", "{#PREFXTBL}", "{#ADDRTYPE}", "{#ASNUM}"]
    
  7. Associate Template Juniper MX to the host.

  8. Add to your host the {$SNMP_COMMUNITY} macro with your SNMP community as value.

  9. Add to your host the {$BGP_PEER_AS} macro with your list BGP peer remote AS as value (ex: ASN1|ASN2|ASN3). These ASs have a high severity triggers.

  10. Go to filter rules for interfaces: Template Juniper MX -> Discovery rules -> JunOS Interfaces -> Filters

  11. Check filter, edit or delete.

Script snmp v3 example:

    LLD.py["-h", {HOST.CONN}, "-v3", "-u{$SNMP_USER}", "-l{$SNMP_LEVEL}", "-aSHA", "-A{$SNMP_AUTH}", "-xAES", "-X{$SNMP_PRIV}", "-mi", "{#PEERADDR}", "-m", "{#PREFXTBL}", "{#ADDRTYPE}", "{#ASNUM}"]

SNMP Version 3 options:

-a PROTOCOL		set authentication protocol (MD5|SHA)
-A PASSPHRASE		set authentication protocol pass phrase
-l LEVEL		set security level (noAuthNoPriv|authNoPriv|authPriv)
-n CONTEXT		set context name (e.g. bridge1)
-u USER-NAME		set security name (e.g. bert)
-x PROTOCOL		set privacy protocol (DES|AES)
-X PASSPHRASE		set privacy protocol pass phrase

Requirements

For script LLD.py: python 3, snmpwalk, snmpbulkwalk.

Info

Template exported from Zabbix 3.X.X. For Zabbix 2.X.X correct discovery rules.

Gitter

zabbix-template-juniper-mx-bgp4-ipv4-ipv6's People

Contributors

leleobhz avatar prototype-x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zabbix-template-juniper-mx-bgp4-ipv4-ipv6's Issues

Value should be a JSON object

Hi! I use zabbix 3.0.22 and latest template and script. When I run script from console, it works fine and shows my BGP peers

{
    "data": [
        {
            "{#ADDRTYPE}": "1",
            "{#ASNUM}": "6768",
            "{#PEERADDR}": "45.14.111.26",
            "{#PREFXTBL}": "7",
            "{#SNMPINDEX}": "0.1.45.14.111.27.1.45.14.111.26"
        },
        {
            "{#ADDRTYPE}": "1",
            "{#ASNUM}": "6768",
            "{#PEERADDR}": "45.14.111.30",
            "{#PREFXTBL}": "6",
            "{#SNMPINDEX}": "0.1.45.14.111.31.1.45.14.111.30"
        },
        {
            "{#ADDRTYPE}": "1",
            "{#ASNUM}": "15738",
            "{#PEERADDR}": "80.84.186.13",
            "{#PREFXTBL}": "11",
            "{#SNMPINDEX}": "0.1.80.84.186.14.1.80.84.186.13"
        },
        {
            "{#ADDRTYPE}": "1",
            "{#ASNUM}": "15738",
            "{#PEERADDR}": "80.254.9.189",
            "{#PREFXTBL}": "10",
            "{#SNMPINDEX}": "0.1.80.254.9.190.1.80.254.9.189"
        },
        {
            "{#ADDRTYPE}": "1",
            "{#ASNUM}": "30777",
            "{#PEERADDR}": "193.201.152.129",
            "{#PREFXTBL}": "12",
            "{#SNMPINDEX}": "0.1.193.201.152.157.1.193.201.152.129"
        },
        {
            "{#ADDRTYPE}": "1",
            "{#ASNUM}": "3326",
            "{#PEERADDR}": "194.146.196.25",
            "{#PREFXTBL}": "4",
            "{#SNMPINDEX}": "0.1.194.146.196.26.1.194.146.196.25"
        },
        {
            "{#ADDRTYPE}": "2",
            "{#ASNUM}": "3326",
            "{#PEERADDR}": "2a01:758:ffe8:1::",
            "{#PREFXTBL}": "5",
            "{#SNMPINDEX}": "0.2.42.1.7.88.255.232.0.1.0.0.0.0.0.0.0.1.2.42.1.7.88.255.232.0.1.0.0.0.0.0.0.0.0"
        },
        {
            "{#ADDRTYPE}": "2",
            "{#ASNUM}": "6768",
            "{#PEERADDR}": "2a01:4a60:0:1::91",
            "{#PREFXTBL}": "8",
            "{#SNMPINDEX}": "0.2.42.1.74.96.0.0.0.1.0.0.0.0.0.0.0.146.2.42.1.74.96.0.0.0.1.0.0.0.0.0.0.0.145"
        },
        {
            "{#ADDRTYPE}": "2",
            "{#ASNUM}": "6768",
            "{#PEERADDR}": "2a01:4a60:0:1::99",
            "{#PREFXTBL}": "9",
            "{#SNMPINDEX}": "0.2.42.1.74.96.0.0.0.1.0.0.0.0.0.0.0.154.2.42.1.74.96.0.0.0.1.0.0.0.0.0.0.0.153"
        },
        {
            "{#ADDRTYPE}": "2",
            "{#ASNUM}": "15738",
            "{#PEERADDR}": "2a06:ff40:0:741::1",
            "{#PREFXTBL}": "13",
            "{#SNMPINDEX}": "0.2.42.6.255.64.0.0.7.65.0.0.0.0.0.0.0.2.2.42.6.255.64.0.0.7.65.0.0.0.0.0.0.0.1"
        }
    ]
}

but in zabbix i get "Not supported" and 'Value should be a JSON object.'
How can I make it working?

JUNIPER-SMI breaks LLD.py

Hi,

There is a bug when you install mib called JUNIPER-SMI the script LLD.py won't work properly anymore. He won't translate ip addresses from hex to decimal.

Regards.

Template import error in Zabbix 6.4.0beta4

Hello,

Can't import Templates.Juniper.MX.xml in Zabbix 6.4.0beta4

Returned error:
Cannot find graph "Interface {#SNMPVALUE} - {{HOST.HOST}:ifAlias[{#SNMPVALUE}].last(0)}" used in dashboard "MX".

Value should be a JSON object.

This Really good template for juniper. Thanks for share.

I have one little problem when ll use script LLD. My discovery rule show this message "Value should be a JSON object."
without Script, the discovery work fine but only show IPs as hex numbers.

any idea how to solve it?

Zabbix Version 3.0.3

Could I see an example output of the LLD.py?

Hello, trying to adapt this script to a Cisco platform since this is the only Zabbix template I've found that properly handles v6 peers. I was curious if you could post some sanitized output from a live router so I can see the format of what the script outputs when working properly? Cisco doesn't have indexes on the peers, they use the remote ip address in the OID, so it's going to take some big changes, but I'd love to just map it all back into the item and trigger discovery so no time wasted recreating all of that.

Thanks

Documentation SNMPv3 key

In your readme for SNMPv3 you have the key listed as:

LLD.py["-h", {HOST.CONN}, "-v3", "-u{$SNMP_USER}", "-l{$SNMP_LEVEL}", "-aSHA", "-A{$SNMP_AUTH}", "-xAES", "-X{$SNMP_PRIV}", "-mi", "{#PEERADDR}", "-m", "{#PREFXTBL}", "{#ADDRTYPE}", "{#ASNUM}"]

I had to change the format to get this working:

LLD.py["-h", {HOST.CONN}, "-v", "3",  "-l", "authPriv", "-u", "{$SNMP_SECURITY}", "-a", "SHA", "-A", "{$SNMP_AUTH}", "-x", "AES", "-X", "{$SNMP_PRIV}", "-mi", "{#PEERADDR}", "-m", "{#PREFXTBL}", "{#ADDRTYPE}", "{#ASNUM}"]

Interface xe-

Hello, just installed your template and its working great! Thanks! :)

Please consider to add new interface type xe- (onboard 10G XFP) to LLD interfaces filter.

xe-0/0/0                up    up
xe-0/0/1                up    down
xe-0/0/2                up    down
xe-0/0/3                up    down      

Discovery REGEX

On the Juniper Interfaces, go to Filters and use this regexp

^(ms|ge|xe)-[0-2]\/[0-2]\/[0-9]$|^(ae|reth|st)[0-9]$|^fxp[0-9]-[0-9]+$|^vlan.[0-9]+$|^irb.[0-9]+$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.