Forum Discussion
jksingh_44237
Nimbostratus
Nov 04, 2011mysql pool configuration in F5
I have to put two mysql servers behind the F5 to balance the mysql db traffic for web servers... I have created the pool for two node & added for virtual also.... But facing the issue to establish the...
Hi there,
You can use HTTP::header (Click here) to check if a header exists and to insert a new header or modify a new header.
Do you want to check if the header name is abc123 or the header value is abc123? Does the order of the HTTP headers matter? By default if you insert a new header it will be inserted after the existing headers. If you need the new header inserted before the existing one, you could insert the new one, save the value of the old one, remove the old one and insert a new instance of the old header.
Aaron
- Sec-Enabled_658Jun 03, 2015
Cirrostratus
I kinda wrote my own, figured that I would share. This script shows each virtual server associated pool, pool member, and also shows the monitor that is being used by the pool. I call it the vipmapper. Also shows which virtual servers don't have a pool assigned. virtuallist=$(tmsh list ltm virtual | grep virtual | cut -d' ' -f3 | tr "\n" " " ); for v in $virtuallist ; do DEST=""; POOL=""; MEMB=""; DEST=$(tmsh list ltm virtual $v | grep destination | cut -d' ' -f6) POOL=$(tmsh list ltm virtual $v | grep pool | cut -d' ' -f6) MEMB=$(tmsh list ltm pool $POOL | egrep ':|address '| sed '$!N;s/\n/ /') MON=$(tmsh list ltm pool $POOL | grep " monitor") if [ "$POOL" != "" ]; then echo ""; echo " Virtual: $v - $DEST"; echo " Pool: $POOL"- $MON; echo "$MEMB"; else echo ""; echo "!! Virtual $v $DEST has no pool assigned"; echo ""; fi done Is there a way to test if a Virtual server exist. I have a bash script that will look at a seed file, if it the virtual server does not exist, it will list all the virtual servers on the device. I want to use an if then else to test, I tried blank, I tried to use "not found", no luck., Anyone have anything close?
Thanks,
@Wallace, assuming your are iterating through a list of VS names and you want to check if they exist first, the following may work. It attempts to list the VS name passed in, if it exists do something, if the command errors ie. the VS doesn't exist do nothing.
tmsh_out=""
tmsh_out=$(tmsh -q list ltm virtual $vs 2>/dev/null)
[[ "$tmsh_out" ]] && echo 1
- Stanislas_Piro2Oct 27, 2017
Cumulonimbus
Hi,
I suggest to replace tmsh command with this one
tmsh list /ltm virtual one-line | grep "pool ${pools}" | awk '{print $3}'