Forum Discussion
Scripting/Automating/greppingVIPS/ pool/nodes V11.
Hello All,
I am working on converting our public space to a new range from a new provider.
I have to get VIP's and Pools names etc.. as well as node adresses and names and am wondering the best possible solution to do this without manually seraching for each. I am pretty familiar and comfortable with the CLI of TMOS/TMSH. I am a complete newbie to scripting etc... I have read the code shares and I do understand the concepts and basic arguments etc.. However, I am not a programmer and am not sure how to even begin.
I am starting to use the F5 quite extensively so maybe I need to just learn TCL? or Pearl or some sort scripting to automate things?
To break it down better I would say I have 2 separate objectives:
1 - How to pull data from the F5 LTM and GTM either from searching from an excel sheet or another type of file with a list of a few hundred IP's. Can I import/create a file in vi and run it in a script?
2 - Vice versa, if I have to create new VIPS/Pools/Nodes etc can I run it from a script that pull the VIP/Pool/node info etc.. I know in big pipe i was able to create a file in VI and put it in the temp folder and do a big pipe merge etc.. (its been a long time so I apologize if the terms are slightly off.)
thank you in advance. Like I said above, I am using the F5 quite extensively at this part and the gui is just too slow. Any input as to how to begin an F5 script/cli expert would be much appreciated.
3 Replies
Not sure if I understood you need, but you can try bigip report: https://devcentral.f5.com/wiki/iControl.Powershell-BigIP-Report-Generator.ashx?NoRedirect=1Requirements_2&NS=iControl
Or you can try this version. I rewrote it a bit so it exports the config to csv files in case that's what you need:
http://climbi.com/b/0hconu
/Patrik
Hi Michael
Could you please give me the error messages? Also, which PowerShell version are you usng?
To see the version you can start a powershell window and paste this command:
$PSVersionTable["PSversion"].Major- Bernie_Ongewe_6
Nimbostratus
Hi CBG.
You'll likely have the best luck finding someone to do it for you in Perl or Python. It should be straightforward for them to read data from CSV then execute the corresponding TMSH command programmatically as long as you give them a template for the latter. In Python, it would look something like;
command_string = "tmsh create ltm virtual "+ vname + \ '{ destination "' + \ vip + " ip-protocol .. (etc, etc)"
os.system(command_string)
where vname, vip, etc are read from the CSV you just gave them. Just a bit more work to scrape the parameters from bigip.conf but they should be able to figure it out once they eyeball it. Just let them know the Python version on F5 is 2.4; had to redo a couple of things having tested in 2.7.
Cheers, Bernie
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
