CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
G-Rob
F5 Employee
F5 Employee

Problem this snippet solves:

I had a request to run an iCall script only on the active member in a pair.


How to use this snippet:

This won't work if you're using active/active via traffic-groups.

Code :

# Only execute if local BIG-IP is active in failover  
 if {[exec cat /var/prompt/ps1] == "Active"} {  
     tmsh::log "I LIKE SOUP!"  
     }

Tested this on version:

12.1
Comments
Walter_Kacynski
Cirrostratus
Cirrostratus

You can also use native tmsh only...

 

    set device_status [tmsh::get_field_value [lindex [tmsh::get_status cm failover-status raw] 0] "status"]
 
    if {$device_status equals "ACTIVE"} {

 

Version history
Last update:
‎13-Aug-2019 06:01
Updated by:
Contributors