iCall Script that only runs on Active member

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:

Published Aug 13, 2019
Version 1.0

Was this article helpful?