title-icon-code

Monitoring the new OS X Server Caching Service with Nagios

In followup to last week’s post on Monitoring Mac OS X Server Software Update Server, here is my new script to monitor the Caching Service on OS X Mountain Lion Server (Server.app 2.2+).

The Caching Service is a deceptively magical new service which automatically caches Apple update and Mac App Store content with no need for client configuration. A very good writeup of what the service actually does can be found at Noel Alonso’s blog.

In classic Apple style, the new Caching Service looks pretty bare on the surface, with a simple toggle and a slider to change the size of your cache. Whilst advanced configuration of the service is definitely possible; from a cursory glance, none of the options or statuses give you a really good idea of what is happening in the background.

This is where the following script works nicely. Checking that the service is active, registered, and accessible to clients provides a good way to monitor that caching of content should occur, but the performance data that the script returns gives you some excellent ways to monitor and analyse cache size and efficiency. As you can see in the graph above, I am able to get a good visual indication over time of how much content my server is caching, as well as how much cached content it is providing to clients versus downloading directly from Apple. In the next few weeks, I will write some articles on the RRDtool commands I am using to produce these graphs.

It is really satisfying to be able to see nice chunks of bandwidth that no longer have to come in via the internet. Enjoy!

check_osx_caching.sh on GitHub

3 Responses to "Monitoring the new OS X Server Caching Service with Nagios"

Add Comment
  1. Pingback: Caching server stats | nbalonso.com

  2. Stitch

    April 3, 2014 at 5:42 pm

    Very nice 🙂

    Reply
    • jedda

      April 3, 2014 at 6:15 pm

      Thanks S. I have some great data around Caching Server & software release dates now (Mavericks, iOS) that I have been meaning to write up for a while now. Would be right up your alley – i’ll let you know.

      Reply

Submit a comment

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