title-icon-code

Checking Carbon Copy Cloner with Nagios

In many Mac OS X Server deployments that I see, a file level cloning tool such as Carbon Copy Cloner or SuperDuper is used to keep a bootable backup of the server OS on a secondary drive. Whilst this is not a coverall backup strategy, nor effective for all services (databases and other files can be left in an inconsistent state on disk), it does provide an excellent emergency boot option that can have essential services back up and running very quickly in the case of a primary drive failure.

Generally, I use a scheduled task with Carbon Copy Cloner (CCC) at about 1am each morning to do a full clone of data from the boot drive to a secondary. It is possible for this process to provide email notifications on completion or failure, but as I prefer all my monitoring through Nagios, I have developed a script to track and check for successful CCC clones.

Full instructions are in the header of the script, but it has a dual purpose. On the Nagios end, the script checks for the existence and age of a hidden file on the clone destination that signifies when the last successful clone took place, and a warning is thrown based on the age threshold you supply. On the CCC end, you simply choose the script as the post-clone scripting action for your scheduled task, and it will handle the creation of the hidden file on your destination if the clone was successful.

It has been added to my OSX-Monitoring-Tools project on GitHub today.

check_ccc_currency.sh on GitHub

Submit a comment

Your email address will not be published. Required fields are marked *