Skip to content

Latest commit

 

History

History
52 lines (46 loc) · 1.39 KB

README.md

File metadata and controls

52 lines (46 loc) · 1.39 KB

Before you use

The goal for this code is to get the information I need. Not consider any optimization and efficiency. Feel free to optimize it.

Purpose

Get BGP advertised routes from Juniper MX and IOS-XR and push them to the remote InfluxDB. To easily compare routes from different PoPs all around the world and know which provider should be the main entrance point for the traffic.

Instruction

  1. Add devices in the host file called hosts.
  2. Change variables in the host_var
ansible_user: "user" <=== Enter Your username on devices. 
ansible_ssh_pass: "password" Enter <==== Your username on devices.
ansible_connection: "network_cli"
ansible_network_os: "cisco.iosxr.iosxr"
os: "xr"

peers:
  1:  ===> This should be unique when you add the new peer.
    name: lab-A9K-ISP  ===> This name would be the name of your measurement in the InfluxDB
    ip: 192.168.2.1    ===> The BGP Peer IP.
  1. Run the ansible-playbook
ansible-playbook -i hosts influx_adv.yml
  1. Modify the information of InfluxDB in push_influx.py
influxdb_ip = '10.1.1.1'
username = 'agent'
password = '@g1nt'
database = 'advertisement'
  1. Install the packages
pip3 install influxdb
  1. Execute the Python code
python3 push_influx.py

You can use Grafana to present the data

image