Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Nicolas_Bernier
Participant

Show configuration scripts VSX

Hi,

I did build a bash script to automaticaly parse the config of our virtual-system each week and backup them. We have about 10 VSs total.

When doing the show configuration, I only seems to get the config from VS0 regardless of the "vsenv" I set. I know this becose the IPs are always the same and one of the VS do have BGP config and it is not showing up. I also know this becose I did compare each file ouput and they are the same.

Is there another way to show the total config of the virtual-system and put it in a file ?

The script is used in Expert mode and execute by a crontab once a week and the lines responsible for parsing the config is the following :

         clish -c "show configuration" > "$TARGET_FILE"_$i".txt"

Here loop that is doing the config parse :

   where $i is the number of vs and $TARGER_FILE.ERROR is my debug file for error in the script

while [ $i != -1 ] && [ ! -f $TARGET_FILE.ERROR ];do
vsenv $i
      clish -c "show configuration" > "$TARGET_FILE"_$i".txt"
i=$[$i-1]
done

Thanks for the help !

5 Replies
Daniel_Taney
Advisor

Are you familiar with the VSX Provisioning Tool? You could achieve this goal by running the tool from your management server. If the Management Server is R80+, the tool is included. If it is Pre-R80, you can download it here. VSX Provisioning Tool

This would output the entire VS config to the screen...

vsx_provisioning_tool -s <VSX MGMT IP> -u <Admin User Account> -p <User Password> -o show vd name <VS name>

You could always pipe the output to a TXT file. The resulting TXT file will give you the full config of the VS. If you ever needed to rebuild the VS, you could use this same TXT file as input for the VSX Provisioning Tool to recreate the VS.

Hope this helps!

R80 CCSA / CCSE
Nicolas_Bernier
Participant

Hi Daniel,

I do know how the VSX provisioning tools work, but I'm trying to not put admin credentials in the script and also I would also like it to be maintenance free for the most part

The other thing regarding the provinsing tool is tehy dont include BGP configuration.

Other than that, I do agree with you it would be the easy solution.

I will try other solution, but if you have other suggestion, feel free to post them.

thanks

Maarten_Sjouw
Champion
Champion

With the script you have it would record all the info you need, the part that is locally configured, like bootp config and dynamic routing, and possible interface bonding config.

All the rest is not required as that is all stored at the management server level and will be restore when you do a vsx_util reconfigure.

I would add a cat of the fwkern.conf file though.

Regards, Maarten
Khalid_Al-Shaww
Employee
Employee

Hi,

clish -c "Clish Command" command executed in Expert mode always shows the information in the context of VSX Gateway itself only (context of VS0) - regardless of the current VS context. This is by design and it is documented under sk115016. I believe you are doing to backup bond and dynamic routing configurations. But the only recommended way to backup VSX is what is documented in sk100395.

0 Kudos
Niels_van_Sluis
Contributor

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events