Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


https://github.com/Juniper/ChassisInfoFetcher



Files: 

View file
nameVagrantfile
height250
View file
namebootstrap.sh
height250





cmd on Windows 10  ( as administrator )
Install VirtualBoxhttps://www.virtualbox.org/wiki/Downloads

Install Vagrant

4- Vagrant installation and creation of the first box

https://www.vagrantup.com/downloads.html


c:\ChassisInfoFetcher>vagrant --version
Vagrant 2.2.9

c:\ChassisInfoFetcher>vagrant plugin list
vagrant-disksize (0.1.3, global)
vagrant-host-shell (0.0.4, global)
vagrant-junos (0.2.1, global)
vagrant-share (1.1.10, global)


download the ChassisInfoFetcher Project 


 

https://github.com/Juniper/ChassisInfoFetcher

c:\>git clone https://github.com/Juniper/ChassisInfoFetcher.git


ChassisInfoFetcher/CIF

notepad hosts.csv

172.30.95.206,NetBox,Netbox,22
172.30.95.174,Netbox,Netbox,22

First modify the vagrantfile:

1- See below to replace the ' " 'and the '-'

2- replace:  config.vm.box = "ubuntu/xenial32"

3- and add the interface id: 2

vb.customize ["modifyvm", :id, "--nictype2", "Am79C973"]


cd C:\ChassisInfoFetcher

vagrant validate

vagrant up

vagrant provisionprovision   ( modify the bootstrap.sh script first, see below )

vagrant ssh

edit / check the host file ( list of routers, switch, firewall )

cd /home/ubuntu/ChassisInfoFetcher

more sudo vi hosts.csv

for example add: 

172.30.95.174,Netbox,Netbox,22


run the app.py

cd /home/ubuntu/ChassisInfoFetcher

sudo python app.py

export resul from the ./output directory






measure how long the 


Code Block
titlemeasure with the time function
collapsetrue
vagrant@ubuntu-xenial:/home/ubuntu/ChassisInfoFetcher$ time python app.py

--------------------------------------------------------------------

  Direct Mode

--------------------------------------------------------------------
2020-05-24 09:31:09,036 - root - INFO - Loading and Verifying Device List : Successful, loaded (1) hosts!
2020-05-24 09:31:09,072 - root - INFO - Connecting to: 172.30.95.174
2020-05-24 09:31:09,234 - paramiko.transport - INFO - Connected (version 2.0, client OpenSSH_7.5)
2020-05-24 09:31:10,002 - paramiko.transport - INFO - Auth banner: !!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! In use by jkriker@juniper.net April to May 2020...................................Please contact me before chaning anything................................................................................................................................................

2020-05-24 09:31:10,003 - paramiko.transport - INFO - Authentication (password) successful!
2020-05-24 09:31:20,513 - root - INFO - Retriving the information from devices : Process finished
Success count: 1. Error count: 0

real    0m17.309s
user    0m1.276s
sys     0m0.688s
vagrant@ubuntu-xenial:/home/ubuntu/ChassisInfoFetcher$


real 0m17.309s # 9sec for click and 8sec 
user 0m1.276s
sys 0m0.688s


With 2 Router:

real 0m25.451s    25-17= 8sec
user 0m2.048s
sys 0m1.156s


With 10 Router:

real 1m22.871s     88sec - 10 = 78sec / 10 # 8sec
user 0m6.816s
sys 0m3.472s


>> selection: # 9 sec

>>  per Router: 8 Sec




Modify the bootstrap.sh script ( post config or provisioning )


Code Block
titleprovision with bootstrap.sh
#!/usr/bin/env bash

apt-get update
sudo apt-get install -y python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev git
sudo apt-get --no-install-recommends install virtualbox-guest-utils
sudo apt-get install python-paramiko
sudo -H python -m pip uninstall pip setuptools wheel
sudo python -m pip install --upgrade pip
sudo python -m pip install --upgrade setuptools wheel
sudo pip install --upgrade junos-eznc
sudo pip install urwid
sudo pip install enum
git clone https://github.com/Juniper/py-space-platform.git
sudo pip install ./py-space-platform
sudo pip list | egrep "setup|wh|pip|junos-eznc|space"




Vagrantrfile is a Ruby file , and there is a

problem with the speech mark.


can check online also:

https://repl.it/languages/ruby



Convert the Encoding



In Notepad++ with the plugin HEX-Editor:

replace e2 80 9d with 22



https://www.utf8-chartable.de/unicode-utf8-table.pl?start=8192&number=128

e2 80 9d ,  e2 80 9c , e2 80 94


Other issue: 








and replace c:\    >>>>>  with   c:/


Image Added