Skip to content
This repository has been archived by the owner on Oct 11, 2020. It is now read-only.

Basic Healthbot demo

Khelil Sator edited this page Mar 8, 2019 · 8 revisions

configure Junos devices

Run the script configure_junos.py to configure BGP and interfaces

$ python configure_junos.py
configured device vMX1
configured device vMX2
configured device vMX3
configured device vMX4
configured device vMX5
configured device vMX6
configured device vMX7
$

audit BGP states

Run the script audit_junos.py to audit BGP states

$ python audit_junos.py
vMX1
bgp session with peer 192.168.1.1+179 is Established
bgp session with peer 192.168.1.3+179 is Established
bgp session with peer 192.168.1.5+179 is Established
bgp session with peer 192.168.1.7+179 is Established
vMX2
bgp session with peer 192.168.2.1+179 is Established
bgp session with peer 192.168.2.3+179 is Established
bgp session with peer 192.168.2.5+179 is Established
bgp session with peer 192.168.2.7+179 is Established
vMX3
bgp session with peer 192.168.3.1+60363 is Established
bgp session with peer 192.168.3.3+62079 is Established
bgp session with peer 192.168.3.5+52800 is Established
bgp session with peer 192.168.3.7+179 is Established
vMX4
bgp session with peer 192.168.1.0+49512 is Established
bgp session with peer 192.168.2.0+51850 is Established
bgp session with peer 192.168.3.0+179 is Established
vMX5
bgp session with peer 192.168.1.2+62518 is Established
bgp session with peer 192.168.2.2+59675 is Established
bgp session with peer 192.168.3.2+179 is Established
vMX6
bgp session with peer 192.168.1.4+57136 is Established
bgp session with peer 192.168.2.4+56420 is Established
bgp session with peer 192.168.3.4+179 is Established
vMX7
bgp session with peer 192.168.1.6+54866 is Established
bgp session with peer 192.168.2.6+56929 is Established
bgp session with peer 192.168.3.6+54291 is Established
$

configure Healthbot

Run the script basic_healthbot_demo.py to configure Healthbot

This will load on Healthbot these files:

This will also configure a device group vmx with the devices vMX1 to vMX7

This will also instanciate the playbooks bgp-using-openconfig and inventory and interfaces-using-openconfig against the device group vmx.

$ python basic_healthbot_demo.py
loaded healthbot table and view system-information.yml
loaded healthbot rule check-system-info.rule
loaded healthbot rule check-bgp-state-using-openconfig.rule
loaded healthbot rule check-bgp-routes.rule
loaded healthbot rule check-interfaces-status-using-openconfig.rule
loaded healthbot rule check-interfaces-description.rule
loaded healthbot playbook bgp-using-openconfig.playbook
loaded healthbot playbook inventory.playbook
loaded healthbot playbook interfaces-using-openconfig.playbook
loaded healthbot configuration for the device: vMX1
loaded healthbot configuration for the device: vMX2
loaded healthbot configuration for the device: vMX3
loaded healthbot configuration for the device: vMX4
loaded healthbot configuration for the device: vMX5
loaded healthbot configuration for the device: vMX6
loaded healthbot configuration for the device: vMX7
loaded healthbot configuration for the device group: vmx
healthbot configuration commited!
$

Devices health:

  • BGP sessions are established
  • number of BGP prefix received is below the configured threshold
  • SW release is the desired one
  • HW model is the desired one
  • spines <-> leaves interfaces are UP/UP
  • spines <-> leaves interfaces description are configured

Device vMX1 health:

basic_demo.png

break something

Run the script remove_interface_description.py to remove interfaces description on devices vMX1 to vMX7

$ python remove_interface_description.py
configured device vMX1
configured device vMX2
configured device vMX3
configured device vMX4
configured device vMX5
configured device vMX6
configured device vMX7
$ ssh 100.123.1.0
Password:
Last login: Fri Mar  8 13:13:17 2019 from 100.123.35.0
--- JUNOS 18.2R1.9 Kernel 64-bit  JNPR-11.0-20180614.6c3f819_buil
jcluser@vMX-addr-0> show configuration | compare rollback 1
[edit interfaces ge-0/0/0]
-   description "to leaf vMX4";
[edit interfaces ge-0/0/1]
-   description "to leaf vMX5";
[edit interfaces ge-0/0/2]
-   description "to leaf vMX6";
[edit interfaces ge-0/0/3]
-   description "to leaf vMX7";

jcluser@vMX-addr-0>

Device vMX1 health

no_interface_description.png

Clone this wiki locally