Forum Discussion
Priority group activation and automatically closing connections when higher priorty group goes UP.
pool_server has 6 pool members, (A,B,C) group priortity is 10; (D,E,F) group priority is 5, tcp monitor use "tcp_delay_up_120s" and its value of "Time Until Up" set 120s;
pool_icall members is (A,B,C), use default tcp monitor
pool_back members is (D,E,F), use default tcp monitor
user_alert.conf
alert poolserver-1-UP "Pool /Common/pool_server member /Common/192.168.100.1:23 monitor status up" {
exec command="tmsh generate sys icall event delete_backserver_session context { { name poolname value pool_ic
all } }"
}
alert poolserver-2-UP "Pool /Common/pool_server member /Common/192.168.100.2:23 monitor status up" {
exec command="tmsh generate sys icall event delete_backserver_session context { { name poolname value pool_ic
all } }"
}
alert poolserver-3-UP "Pool /Common/pool_server member /Common/192.168.100.3:23 monitor status up" {
exec command="tmsh generate sys icall event delete_backserver_session context { { name poolname value pool_ic
all } }"
}
icall config:
list sys icall handler triggered delete_backserver_session
sys icall handler triggered delete_backserver_session {
script delete_backserver_session
subscriptions {
delete_backserver_session {
event-name delete_backserver_session
}
}
}
list sys icall script delete_backserver_session
sys icall script delete_backserver_session {
app-service none
definition {
foreach var {poolname} {
set $var $EVENT::context($var)
}
puts "poolname is $poolname"
exec /bin/bash /var/tmp/delete_backserver_session.sh
}
description none
events none
}
chmod +x /var/tmp/delete_backserver_session.sh
#!/bin/bash
count=`tmsh list ltm pool pool_icall | grep "state up" | wc -l`
if [ $count -ge 2 ]
then
for i in `tmsh show ltm pool pool_back members | grep -E "Ltm::Pool Member:" | awk '{print $NF}'`
do
address=`echo $i | awk -F ":" '{print $1}'`;
port=`echo $i | awk -F ":" '{print $2}'`
tmsh delete sys connection ss-server-addr $address ss-server-port $port
done
fi
- Asura2006Nov 29, 2022Altocumulus
Thanks for this very detailed answer, when i implement it on test environment ill get back to you.
One thing about the script delete_backserver_session.sh also configuration in user_alert.conf and icall config what about maintaining them? Will they be automatically migrated during software upgrade or ill have to remember about them and copy them every time i do upgrade?
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