Tag Archives: 10.8
title-icon-code

Monitoring Mac OS X Server Software Update Server with Nagios

Many organisations use an internal Apple Software Update server to save bandwidth and control distribution of Apple supplied updates. With the introduction of the new Caching service in Mountain Lion server, the uptake in these kind of internal caching and update services is only going to rise.

The model for an internal Apple Software Update server however, has no easy failover or timeout built in, and therefore assumes excellent uptime for the service. If your service breaks down, users will not have access to any software updates, and many Mac admins will speak of how finicky and hateful the Software Update service can be at times.

With that, here is my Nagios monitoring script for the Software Update service. It will ensure the service is both running and accessible on it’s service port, then return performance data on the number of mirrored and enabled packages, as well as the overall size of your mirrored update cache.

I have also completed and am using a similar script for monitoring Apple’s new Caching service in Mountain Lion Server, and will release it this week after collecting enough historical data to make a pretty graph.

For now, here is check_osx_swupdate.sh:

check_osx_swupdate.sh on GitHub

title-icon-code

Monitoring Mac OS X Server DHCP service with Nagios

Whilst not recommended as the primary DHCP server for large networks, Mac OS X Server is quite competent at providing leases for a subnet or two, particularly when coupled with NetBoot services. In our testing lab, we use a Mac OS X server for this exact purpose, serving as a NAT gateway, and providing DHCP and NetBoot services to a subnet, and we have had issues in the past with the underlying bootpd process locking up or too many clients on the subnet exhausting available leases.

With that, I have added a script to check the DHCP service on Mac OS X server. It will work on 10.6-8, and will check that the DHCP service is running, and then return performance data on the number of provided leases and active clients.

Over the next few weeks, I am planning to detail some of the workflows I am using to generate graphs like the one pictured above, giving excellent visibility into the historical performance of your Mac services.

check_osx_dhcp.sh on GitHub

title-icon-code

Configuring basic RADIUS on OS X 10.8 Server

For small deployments of Mac OS X Server, RADIUS based Wi-Fi referencing Open Directory can be a clean, secure way to provide employee access to the business network, and mitigates the problems of having one shared passphrase that rarely changes. Apple have provided automatic configuration of RADIUS and Airport base stations in OS X server for a while, but the FreeRADIUS install used by Mac OS X is of course able to provide RADIUS services to non-Apple APs and VPN services. Whilst not recommended for large deployments, this setup can do a very good job for many small to medium businesses with a highly mobile workforce.

In 10.8 server, like many services embraced in years gone by, RADIUS has disappeared into the deep dark depths of command line configuration. The following commands will get basic RADIUS functional on 10.8 Mountain Lion server for use with whichever RADIUS authenticator you wish.

All of the commands below assume that you are elevated to superuser:

sudo -s

Firstly, we have to create the SACL for accessing the RADIUS service:

dseditgroup -q -o create -u -n . com.apple.access_radius

Now, set some logging options for the RADIUS service. We want to log authentication attempts good and bad, and rotate logs and accounting information regularly:

radiusconfig -setconfig auth yes
radiusconfig -setconfig auth_badpass yes
radiusconfig -setconfig auth_goodpass yes
radiusconfig -autorotatelog on -n 15

Now we are going to add a client (RADIUS authenticator – access point, VPN endpoint). The first argument here is the IP of the client, the second is a shortname (alias), and the third is the client type. In most cases, this is other. More info can be found on types by reading the config files in /etc/raddb:

radiusconfig -addclient <IP> <short-name> other

Now, we need to generate or export an existing certificate for use with the RADIUS service. You need your certificate identity (certificate and private key) in a .p12 file to be referenced in the next set of commands. If you are unsure how to do this, the whole process is completed in the video at the bottom of this post.

Next, split the certificate identity into a separate, unencrypted certificate and private key, then install them into your RADIUS configuration:

openssl pkcs12 -in /Users/admin/Desktop/Identity.p12 -out /etc/raddb/certs/server.key -nodes -nocerts
openssl pkcs12 -in /Users/admin/Desktop/Identity.p12 -out /etc/raddb/certs/server.crt -nodes -nokeys
radiusconfig -installcerts /etc/raddb/certs/server.key /etc/raddb/certs/server.crt

At this stage, you can run radiusd with a debug flag to ensure everything is running as planned. With the -X flag on, you will see far more verbose output than you will ever see in the service logs, so if you are having any trouble, use this flag and look for problems:

radiusd -X

If everything went as planned, you will see Ready to process requests. at the end of your output. Now, add a user to the com.apple.radius_access local server group, and test authentication. You should see a whole lot of output fly by, and eventually catch a Sending-Access-Accept block when the user is authenticated, authorised, and connects.

Now, you can kill the debug process with Control-C, and start the service properly. This will start the RADIUS service and make it persistent across reboots:

radiusconfig -start

With that, you should have a fully functional basic RADIUS setup going. For all the commands inline, head over to this github:gist. For a more involved overview of the steps, check out the video.

The video below is a run through of all the steps required to get basic RADIUS configuration functional on a fresh 10.8 server instance, including Open Directory promotion, user and SACL creation, and importing a new self-signed certificate into your config. In this lab, we are using an Aerohive AP330 access point as the authenticator and access point for our wireless network.


I hope you found the commands and video lab useful.

List of all commands on github:gist