I’m running a few LTM’s on 9.2.4. I’m trying to setup a cron job to automatically sync the active to the standby device every x amount of time. I found this script in some other forums:
!/bin/sh
for Status in $(bigpipe failover show | grep -c “The failover state is ACTIVE”)
do
if [ $Status -eq 1 ]
then
/bin/bigpipe configsync all
else
echo “This unit is currently in Standby mode” >> /var/logsync.log
fi
done
Seems to work except I believe it was written for 4.x and the bigpipe failover show command no longer returns “The failover state is ACTIVE” or standby. Instead, it returns “FAILOVER active for xxx days”, regardless of if you’re on the active or standby device.
Is there an equivalent command that returns active or standby that I could substitute in this script in order to make it work? Alternatively, is there another way to go about this script that will work?
I appreciate any help.
===============================================
Edit: This is the corrected script if anyone finds they need it.
!/bin/sh
for Status in $(bigpipe failover show | grep -c “FAILOVER active”)
do
if [ $Status -eq 1 ]
then
/bin/bigpipe configsync all
else
echo “This unit is currently in Standby mode” >> /var/logsync.log
Actually it should say “FAILOVER active” on the active and “FAILOVER standby” on the standby. If it states “FAILOVER active” then there is something definately wrong in your configuration.
We have several HA pairs and wanted to do the config sync with CRON as well. I actually had time to discuss this with a case engineer about do this in a straight forward fashion without a lot of PERL script or other script.
There is a simple single command line option to do this within the BIGPIPE commands. The preference would be to do a PULL from the standby unit instead of a push to put the work on the standby unit with more free resources than from the active unit.
The use of “PS1” is definitely a better way to go, especially if you have a mixed environment. For example, the output of “b failover” on an 6800 running 9.3.1:
b failover
FAILOVER standby for 3 days 22:37:17
versus an 8800 running 9.4.3:
b failover
FAILOVER
Using “PS1” makes your cron job a little more portable.
Of course this would be a moot point if “auto sync” was incorporated…I seem to remember a post in the iControl9.x forum back in 2005 about that coming in the “next” release…
the above one sounds like a better solution. I m a newbee to F5 and linux. Can anybody help me out in setting up the above task as cron job scheduled daily at 9 o clock. Detail steps would be appreciated. one more confusion that
“bigpipe fo | grep -q “FAILOVER standby” && nice b config sync pull” is a command or a script as mentioned in one blog