Ethernet Switching
Highlighted
Ethernet Switching

Bash script to collect data or make configuration on QFX series

‎10-04-2012 03:05 AM

Hi Everyone,

 

I got a couple of PMs about some posts on bash scripts, so posting a message on the forum.

 

For QFX3500 and QFX3600: We can use the following executable to reach the CLI mode:  /usr/sbin/cli 

Now we can leverage this executable in a simple script to collect any data or to push any configuration:

 

 

#!/sbin/sh

 while [ 1 ]

 do

 /usr/sbin/cli -c "edit;load update /var/home/regress/baseline-config.conf;commit;exit"

 sleep 60

 /usr/sbin/cli -c "edit; load update /var/home/regress/new-vrf-uni-l2-lag-scaled;commit;exit"

 sleep 120

 done

 

 

On the larger qFabric systems, the location of this executable is: /opt/demo/mgd/bin/cli /opt/demo/mgd/bin/cli 

Rest all remains the same.

 

While working on issues, I've found these very useful when it comes to fetching data at regular intervals (specially in case of chronic connectivity issues where we can't rely on external servers to collect data).

 

HTH,

ankit

Feedback