04-Oct-2022 05:51
Hi guys ,
i have a scenario with a pool with two members ,Server A and Server B with priority group activated .
Server A - 192.168.16.80 pga 15
Server B 192.168.18.211 pga 10
i created an iCall script and what i`m trying to accomplish is that when Server A will be down i want Server B to have a higher priority group so when Server A is back online it will be join pool as standby.
1) i created an alert /user_alert.conf
alert server1-down "Pool /Common/TeststanbyNode /Common/192.168.16.80:80 monitor status down." {
exec command="tmsh generate sys icall event change_pga context { { name ip value 192.168.16.80 } {name port value 80} }" }
2)created script
sys icall script /Common/pool_member1_down {
app-service none
definition {
exec modify ltm pool TeststanbyNode members modify { 192.168.18.211:80 {priority-group 20}}
}
description none
events none
}
3)Handler
04-Oct-2022 13:39
you're calling event change_pga from alertd but then icall script is expecting change-priority. Align those and you should be good to go.
05-Oct-2022 02:27
Hi Jason thnx a lot , now i`m getting this error on /var/ltm logs when i execute :
generate sys icall event change_priority
tmsh[19010]: 01420006:3: members: required brace is missing "{"
err scriptd[3868]: 014f0013:3: Script (/Common/pool_member1_down) generated this Tcl error: (script did not successfully complete: (Syntax Error: members: required brace is missing "{"
and when i manually put node down no errors on /var/ltm logs except that pool member monitor is down but no change on priority.
Thnx
05-Oct-2022 08:29
ah..two things.
tmsh::modify ltm pool TeststanbyNode members modify \{ 192.168.18.211:80 \{priority-group 20\}\}
06-Oct-2022 02:12
yeapp that did work ,
but still cant figure out with smth with alertd,when i mark the node down manually i can see on ltm log that
Pool /Common/TeststanbyNode member /Common/192.168.16.80:80 monitor status node down.
but lets say its not triggering the event
alert server1-down "Pool /Common/TeststanbyNode /Common/192.168.16.80:80 monitor status node down." {
exec command="tmsh generate sys icall event change_pga context { { name ip value 192.168.16.80 } {name port value 80} }" }
can you double check ,and also idk if its worth mentioning but Big-IP version is 14.1.2.3.
ah also if i try and run "generate sys icall event .. " it works and script changes the pga.
Thnx
06-Oct-2022 06:59
HI ikkut23:
I tested it a little bit The following is my config,
It can work normally, for your reference
#
cat /config/user_alert.conf
alert server1-down "Pool /Common/TeststanbyNode member /Common/node_10.1.20.13:80 monitor status down." {
exec command="tmsh generate sys icall event change_pga context { { name ip value node_10.1.20.13 } {name port value 80} }"
}
#
tmsh list sys icall script pool_member1_down
sys icall script pool_member1_down {
app-service none
definition {
foreach var { ip port } {
set $var $EVENT::context($var)
}
tmsh::modify ltm pool TeststanbyNode members modify \{ $ip:$port \{priority-group 20\} \}
}
description none
events none
}
#
tmsh list sys icall handler triggered change_pga
sys icall handler triggered change_pga {
script pool_member1_down
subscriptions {
change_pga {
event-name change_pga
}
}
}
have a good day!
05-Oct-2022 05:34 - edited 05-Oct-2022 05:48
Thanks