Forum Discussion

ikkut23's avatar
ikkut23
Icon for Altostratus rankAltostratus
Oct 04, 2022

iCall script not working

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

create sys icall handler triggered pool_member_down script pool_member1_down subscriptions add { change_pga {event-name change_priority} }
 
 
any idea what is wrong with my script 
 
 
Thank you in advance
Regards
 
  • 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.

  • 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 

    • JRahm's avatar
      JRahm
      Icon for Admin rankAdmin

      ah..two things. 

      1. Use tmsh::modify instead of exec, no need to leave the script to modify objects (this is an optimization, not a fix)
      2. Escape your braces:
      tmsh::modify ltm pool TeststanbyNode members modify \{ 192.168.18.211:80 \{priority-group 20\}\}
      • ikkut23's avatar
        ikkut23
        Icon for Altostratus rankAltostratus

        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