This script runs a series of checks before rebooting the unit.
- Check Active/Standby state based upon the output of bigpipe failover show
- Check Peer status (up/down) - based upon the result of ping -c 1 -w 5 peer ('peer' is the hostname of the peer BIGIP)
- Check the uptime to see when the last time the unit was started, if under a given period then don't reboot
- Check configuration synchronisation status based upon the output of bigpipe config sync show
Each check/task will output to STDOUT and syslog (facility: local0.notice tag: BIGIP-ADMIN-SCRIPT). Also a result file (/tmp/reboot-cron-job-result) that will be left in place until next run and will also be e-mailed to 'email@example.com' (change this to suit your environment).
The same reboot.sh script is used on each unit.
Still some tidying up to do - like using a lockfile and better error handling like using 'set -e' and 'set -u' and traps.
I run this script using a cron job that occurs at the start of our weekly maintenance window. You can also use this script as a safe way to force a failover and reboot.