Versions Compared

Key

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

https://github.com/Juniper/ChassisInfoFetcher

Dockerfile

View file
nameDockerfile
height250




https://github.com/Juniper/ChassisInfoFetcher
Virtulbox must be install
Docker Toolbox on windows 10

Image Modified

Get the ChassisInfoFetcher app

in the host

cd c:/

Get the Chassis Info Fectcher folder

git clone https://github.com/Juniper/ChassisInfoFetcher

cd ChassisInfoFetcher



Code Block
titlemodified dockerfile
collapsetrue
FROM ubuntu:xenial as build

RUN apt-get update \
	&& apt-get install -y python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev git \
	&& apt-get --no-install-recommends install -y virtualbox-guest-utils \
	&& apt-get install -y python-paramiko
RUN python -m pip uninstall pip setuptools wheel\
	&& python -m pip install --upgrade pip \
	&& python -m pip install --upgrade setuptools wheel
RUN pip install --upgrade junos-eznc \
	&& pip install urwid \
	&& pip install enum \
#	&& git clone https://github.com/Juniper/py-space-platform.git \
#	&& pip install ./py-space-platform \
#	&& pip list | egrep "setup|wh|pip|junos-eznc|space" \
    && pip install requests \
    && pip install git+https://github.com/Juniper/py-space-platform.git@v1.0.0
RUN git clone https://github.com/Juniper/ChassisInfoFetcher.git
git clone


 

Building the Docker image
docker build -t cif <full-

< Dockerfile

path>/ChassisInfoFetcher

Running the application inside a container
docker run -it cif


List all the container

docker ps --all



Remove all container!!!

docker rm $(docker ps -a -q)




In the container

cd ChassisInfoFetcher/CIF/


echo "172.30.95.174,Netbox,Netbox,22" > hosts.csv

python alpp.py




Result 


Code Block
titleoutput directory
root@903d1e0f06a0:/ChassisInfoFetcher/CIF# ls -lh ./output/
total 16K
-rw-r--r-- 1 root root 4.2K May 24 15:29 output.log
-rw-r--r-- 1 root root 2.6K May 24 15:29 router_172.30.95.174.xml
-rw-r--r-- 1 root root 2.6K May 24 15:29 show_chassis_hardware_detail__display_xml.xml


Code Block
titlerouter
collapsetrue
root@903d1e0f06a0:/ChassisInfoFetcher/CIF# more ./output/router_172.30.95.174.xml
root@SRX300-1-RL102> show chassis hardware detail | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/19.4R0/junos">
    <chassis-inventory xmlns="http://xml.juniper.net/junos/19.4R0/junos-chassis">
        <chassis junos:style="inventory">
            <name>Chassis</name>
            <serial-number>CV3016AF0526</serial-number>
            <description>SRX300</description>
            <chassis-module>
                <name>Routing Engine</name>
                <version>REV 0x08</version>
                <part-number>650-065039</part-number>
                <serial-number>CV3016AF0526</serial-number>
                <description>RE-SRX300</description>
                <clei-code>INMA410ARA</clei-code>
                <model-number>SRX300</model-number>
                <chassis-re-disk-module>
                    <name>da0</name>
                    <disk-size>7671</disk-size>
                    <model>ATP CG eUSB</model>
                    <serial-number></serial-number>
                    <description>Nand Flash</description>
                </chassis-re-disk-module>
                <chassis-re-usb-module>
                    <name>usb0 (addr 1)</name>
                    <product>product 0x0000</product>
                    <product-number>0</product-number>
                    <vendor>vendor 0x0000</vendor>
                    <description>uhub0</description>
                </chassis-re-usb-module>
                <chassis-re-usb-module>
                    <name>usb0 (addr 2)</name>
                    <product>product 0xaf01</product>
                    <product-number>44801</product-number>
                    <vendor>vendor 0x14af</vendor>
                    <description>umass0</description>
                </chassis-re-usb-module>
            </chassis-module>
            <chassis-module>
                <name>FPC 0</name>
                <description>FPC</description>
                <clei-code>INMA410ARA</clei-code>
                <model-number>SRX300</model-number>
                <chassis-sub-module>
                    <name>PIC 0</name>
                    <description>6xGE,2xGE SFP Base PIC</description>
                    <clei-code>INMA410ARA</clei-code>
                    <model-number>SRX300</model-number>
                </chassis-sub-module>
            </chassis-module>
            <chassis-module>
                <name>Power Supply 0</name>
            </chassis-module>
        </chassis>
    </chassis-inventory>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>
root@903d1e0f06a0:/ChassisInfoFetcher/CIF# more ./output/
output.log                                     router_172.30.95.174.xml                       show_chassis_hardware_detail__display_xml.xml



Code Block
titleshow
collapsetrue
root@903d1e0f06a0:/ChassisInfoFetcher/CIF# more ./output/show_chassis_hardware_detail__display_xml.xml
root@SRX300-1-RL102> show chassis hardware detail | display xml
<rpc-reply xmlns:junos="http://xml.juniper.net/junos/19.4R0/junos">
    <chassis-inventory xmlns="http://xml.juniper.net/junos/19.4R0/junos-chassis">
        <chassis junos:style="inventory">
            <name>Chassis</name>
            <serial-number>CV3016AF0526</serial-number>
            <description>SRX300</description>
            <chassis-module>
                <name>Routing Engine</name>
                <version>REV 0x08</version>
                <part-number>650-065039</part-number>
                <serial-number>CV3016AF0526</serial-number>
                <description>RE-SRX300</description>
                <clei-code>INMA410ARA</clei-code>
                <model-number>SRX300</model-number>
                <chassis-re-disk-module>
                    <name>da0</name>
                    <disk-size>7671</disk-size>
                    <model>ATP CG eUSB</model>
                    <serial-number></serial-number>
                    <description>Nand Flash</description>
                </chassis-re-disk-module>
                <chassis-re-usb-module>
                    <name>usb0 (addr 1)</name>
                    <product>product 0x0000</product>
                    <product-number>0</product-number>
                    <vendor>vendor 0x0000</vendor>
                    <description>uhub0</description>
                </chassis-re-usb-module>
                <chassis-re-usb-module>
                    <name>usb0 (addr 2)</name>
                    <product>product 0xaf01</product>
                    <product-number>44801</product-number>
                    <vendor>vendor 0x14af</vendor>
                    <description>umass0</description>
                </chassis-re-usb-module>
            </chassis-module>
            <chassis-module>
                <name>FPC 0</name>
                <description>FPC</description>
                <clei-code>INMA410ARA</clei-code>
                <model-number>SRX300</model-number>
                <chassis-sub-module>
                    <name>PIC 0</name>
                    <description>6xGE,2xGE SFP Base PIC</description>
                    <clei-code>INMA410ARA</clei-code>
                    <model-number>SRX300</model-number>
                </chassis-sub-module>
            </chassis-module>
            <chassis-module>
                <name>Power Supply 0</name>
            </chassis-module>
        </chassis>
    </chassis-inventory>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>
root@903d1e0f06a0:/ChassisInfoFetcher/CIF#