CCS: "show bootvar" output to variables

Posts: 2
3360     1



For my job I'm currently working on a script to detect the firmware version of both the active and non active firmware image of our SF300 switches, and then update them if they are not the latest. However, this is the first time for me using CCS, and I am not known with Perl and neither are my co-workers. I have read the Trigger-Template documentation in the Infoblox CCS Scripting Guide (6.7) and I've been looking around on the forums, but have not been able to understand it yet.


Here is the output of the "show bootvar" from one of the SF300 switches.


Image  Filename   Version     Date                    Status
-----  ---------  ---------   ---------------------   -----------
1      image-1    10-Oct-2013  17:15:41   Active*
2      image-2     29-Mar-2015  16:24:16   Not active


Basicly, I would like to put the Version and Status of both images into variables, so I would end up with 4 variables (i.e. $img1Version, $img2Version, $img1Status and $img2Status).


Thanks in advance,


Re: CCS: "show bootvar" output to variables

Posts: 75
3360     1

So in your script use the action command to run the show command.  This will give you some cli output to work with.  From there have the output of the action command be a trigger comamnd.  The trigger then has what is called  a trigger variables and template which you use to grab the values.  Once you have the values use Trigger-Commands to do the stuff you want.  You can use a Trigger-Filter or a Filter on the Trigger-Command to specify which values to use and which to ignore.


I put a small example of how to get the values and populate the trigger template below. You'll want to test it, but it's a start.  Let me know how it goes.


   Run show command

SET: $UpdateMade = "no"
show bootvar

Make me some variables

Make me some variables


##This defines the variables##
$img1Version word

$img2Version word

$img1Status word

$img2Status word


##This populate the variables##
1 image1 [[$img1Version]]  some more stuff [[$img1Status]]


##This is the part where I do something##

Run the commands to update stuff here


Re: CCS: "show bootvar" output to variables

Posts: 2
3361     1

Yes, that was exactly what I was looking for. Thank you!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You