Forum Discussion
Brian_Yeager_12
Nimbostratus
Sep 11, 2008Config Sync with Cron
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
fi
done
- The_Bhattman
Nimbostratus
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. - hoolio
Cirrostratus
ps1 should return the state of the current unit. - Brian_Yeager_12
Nimbostratus
Ah, you're absolutey right cmbhatt, I'm embarrassed I missed that. I read it wrong. Appreciate your help. - Jeff_46819
Nimbostratus
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. - Orion
Nimbostratus
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: - hoolio
Cirrostratus
ps1 is cleaner, but you should be able to run 'b failover show' to get the same failover state on 9.3.x and 9.4.x: - Orion
Nimbostratus
Perhaps, however: - Luke_Lehman
Employee
See below. - Luke_Lehman
Employee
Posted By jphugo on 09/16/2008 7:55 AM
- Ronnie_79064
Nimbostratus
bigpipe fo | grep -q "FAILOVER standby" && nice b config sync pull
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects