Code:
#!/bin/bash
#< ensuring both F5's configs are in sync
a='echo b failover!'
b='The failover state is ACTIVE.'
echo b failover | sh
echo $a
if [ "$a eq "$b""]
then
b config sync
exit
This most likely wont work..
Since I have no experience with Big-ip, I'm not very good at communicating with any of the nodes, but something like this migth get you further:
Code:
#!/bin/sh
#
# script to check if backup node is active and in sync with master node
# get ACTIVE or anything else from the node
ACTIVE=`bigip failover`
if [ "$ACTIVE"x != x ]; then
# there is a value stored in $ACTIVE
case "$ACTIVE" in
"The failover state is ACTIVE.")
logger -t Big-ip -p local3.info "Syncing the two nodes config"
bigip config sync
;;
* )
# Anything which dosn't match our criteria
logger -t Big-ip -p local0.notice "Unexpected return from failover check: $ACTIVE"
;;
esac
else
# $ACTIVE contains nothing, perhaps an error ??
logger -t Big-ip -p local0.notice "Unexpected NULL from failover check"
fi
In addition, if I can be so cheeky If I would like to send success or failure to syslogger???
Look at the logger(1) program:
NAME
logger - a shell command interface to the syslog(3) system log module
SYNOPSIS
logger [-isd] [-f file] [-p pri] [-t tag] [-u socket] [message ...]
Bookmarks