Forum Discussion
Removing AAM/WAM for a successful upgrade
Identifying the iApp name or names that contain a specific setting that needs to be changed and then building a modify statement takes a few steps that usually involves setting a variable or two.
In this example from the article, I am looking for specific known values (wam-tcp-lan-optimized, etc) and then we add more values to the string by using tmsh with grep that is then cleaned up with awk, tr and sed.
PROFILES="wam-tcp-lan-optimized|wam-tcp-wan-optimized|wom-tcp-lan-optimized|wom-tcp-wan-optimized|"$(tmsh -c 'cd /; list ltm profile recursive one-line' | grep -E "defaults-from.*(wam|wom|webacceleration)" | awk '{print $4}' | tr '\n' '|' | sed '$s/.$/\n/')
awk is grabbing the fourth "word", then tr is replacing the newline character with a grep friendly pipe character and sed is replacing the last character with a new line character.
Now we have a string that is formatted to pass into a grep statement to look for any of these values in a larger set of data.
Now we want to grab virtual server names that are associated with iApps and use profiles that we found earlier. The attribute that is set in all objects which ties them into an iApp is the app-services (in the GUI this is shown as Application) setting. By default that is set to a value of none, so we can have grep eliminate those lines. Note that the awk command is grabbing the 10th word as the app-service name is a bit deeper in the config line.
inScopeiApp=$(tmsh -c 'cd /; list ltm virtual recursive one-line all-properties' | grep -E "(profiles.*($PROFILES))" | grep -v "app-service none" | awk '{print $10 }' | tr '\n' '|' | sed '$s/.$/\n/')
Now we can look at the iApps on the device, filter on the ones we just found, as well as filtering based on the status of the Strict Updates (in the conf files and tmsh output this is shown as strict-updates) setting.
tmsh -c 'cd /; list sys application service recursive one-line all-properties' | grep -E "strict-updates enabled" | awk '{ print "/" $4 }' | grep -E $inScopeiApp
Now that you have that list of iApps, you can pipe that to xargs and modify the settings as you see fit. In the previous comment here I have a command that disables strict on every iApp, which is likely not a good thing to do. Now you know how to filter that list down to just the ones that you are interested in.
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