Tag Archives: project

Introducing Counterpart: a live bootable clone tool for OS X

These days, backing up Mac OS X Server is easier than ever, with plenty of options available for taking incremental backups of system and service data, and great support from Time Machine’s ServerBackup process in making sure that databases and Open Directory are included in hourly backups.

All of these great options have one thing in common though: restoration. In a production environment, as lovely as backups are; admins are often hounded by management and users when hardware fails, and time elapses whilst operating systems are re-installed and service data rolled back from backup drives. To combat this downtime, I like to keep a fully bootable backup connected to each production server that is as up to date as possible. In many situations, this allows you to get a slightly data-delayed version of your environment up and running until you can schedule proper downtime to restore backed up data. For years, I utilised Mike Bombich‘s fantastic tool Carbon Copy Cloner, along with it’s excellent Scheduled Tasks functionality for this exact purpose. With it’s recent move to shareware, I decided that there really should be a free, open source script for cloning Mac OS X that can be scheduled with launchd, and provides proper logging and statistical data. It is with this that I announce the release of Counterpart; a wrapper script for rsync on OS X that is capable of producing bootable clones of live Mac systems. I have been using this for a little over 6 months to backup hundreds of OS X systems, and it has made my life so much easier a couple of times during hardware failures.

Counterpart utilises rsync, the fantastic data and synchronisation utility, and wraps it in a script that provides the correct settings and filesystem exceptions to create a bootable clone of a live Mac system, whilst error checking and providing comprehensive logging, statistics and monitoring data. It is bundled with detailed documentation and instructions on scheduling clones. Coming soon is a companion Nagios plugin script to monitor clones and provide performance data, meaning you can be sure clones are completing successfully, and get insights into your backup data like this:

Counterpart Clone Statistics

It should also be said that whilst Counterpart was first envisaged to backup Mac OS X Server instances, there is nothing stopping it being used to back up standard OS X clients, and it would be a great, fully scriptable, free way to create a bootable clone of your OS before an upgrade or significant modification to your system.

I have uploaded Counterpart as a new project on GitHub, and welcome any feedback that you may have on using it. I am also happy to answer any questions on getting it set up in your environment, and I am best contacted using this form.

Counterpart on GitHub


Checking certificate expiry on Lion Server with Nagios

Mac OS X Server has had simple notifications on critical disk space, software updates, and certificate expiry for a while now.

For those of you who would like a neat way to integrate more customisable certificate expiry checks into a Nagios workflow, I have added check_certificate_expiry.sh into my OSX-Monitoring-Tools project today. It will allow you to specify a warning threshold, and then check expiry dates of all certificates in /etc/certificates.

OSX-Monitoring-Tools on GitHub


OSX Nagios Monitoring Tools & Scripts

Keeping an eye on your Mac OS X server instances can be a bit painful, with Apple’s inbuilt notification options limited to emails when software updates, expired certs, or super full volumes pop up. Having real time and historical data on your services health and performance can help with your troubleshooting workflow, and getting a near instant notification of an impending drive failure sure beats trudging out at midnight to an emergency maintenance callout.

For years, I have deployed the ever improving Groundwork Monitor to monitor our internal and customer infrastructure, and their recently announced Core licence provides free monitoring for up to 50 devices. Groundwork’s Nagios core brings with it a wealth of plugins for monitoring servers, network devices, and a plethora of services, but a Mac administrator might struggle to find plugins that can provide nice performance data, or even provide valid output on OSX without 5 hours of dependency building.

Below is a link to my new project hosted on GitHub. These are the scripts and tools I have authored over the years to monitor OSX and associated infrastructure. After a thorough cleaning of some old code, i’ll add the rest, as well as anything new, with a plan to keep them in development, and open to everyone:

Visit the project on GitHub

Over the next little while, i’ll also be posting some articles on how you can leverage the standard Nagios plugins to monitor services and hardware on the Mac platform too. I hope these additions make your life a little easier.