Forum Discussion
don_23889
Nimbostratus
Dec 28, 2009grep'ng for 'string' in bigip.conf
grep'ng for 'string' and returning entire block of object definitions from bigip.conf for each instance of 'string', starting with 'virtual' and ending with '}'
config less bigip.con...
hoolio
Cirrostratus
Feb 09, 2011Posted By hwidjaja on 01/02/2010 09:35 AM
It seems like this awk one-liner is better than my previous one:
Hey Humphrey,I ended up using this one liner to extract all of the monitors from the bigip.conf for a 9.x customer working on their upgrades. Just wanted to say thanks again for this gem.In case anyone is looking for an ugly script to update 9.x monitors to make them 10.x compatible, here you go:It basically replaces \n's that don't have a preceding \r with \r\n and appends up to two \r\n's to the end of all send strings if they're not there already. The input is the bigip.conf. The output is written to an SCF file which is then imported back into memory and saved to disk with a 'b save'. It's not thoroughly tested (yet), but should save a lot of time manually updating monitor send strings.Aaron
awk 'BEGIN {RS="\n}";FS=RS} /rules SNAT2VIP/ {print $1"\n}";} ' /config/bigip.conf
b save; awk 'BEGIN {RS="\n}";FS=RS} /monitor .*defaults from/ {print $1"\n}";}' /config/bigip.conf | perl -pe 's/(? /var/tmp/monitors.scf; b merge /var/tmp/monitors.scf; b save
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
