Tag Archives: scripts

Checking Kerio Connect statistics with Nagios

Added to my OSX-Monitoring-Tools project today is a bash script to check statistics for Kerio Connect. This bash script lets you define the standard warning and critical thresholds on any key in the stats.dat file generated by Kerio, and also returns clean performance data (great for Groundwork graphs!).

The complexity here is that Kerio’s statistics are a constant counter until reset, so in order to gather useful data, you have to reset the stats each time the check is run. This functionality is built into the script thanks to the Kerio Admin API, so simply set your check interval, and enjoy statistics based on that. The graph above is “HTTPConnections” graphed on a production Kerio Connect server every 10 minutes.

You will need to enter a few variables into the script itself to allow it access to the API in order to reset statistics, but the counter names and thresholds can be entered as arguments.

check_kerio_connect_stats.sh on GitHub


Checking APNs reachability with Nagios

What?!I have deployed a couple of Profile Manager instances where the Apple Push Notification Service (APNs) was reachable at install, but due to some over zealous network administration, connectivity was lost along the way.

The big issue with this is that as a fairly silent failure, it may take a minute to troubleshoot why changes aren’t pushing to devices. If you have your Profile Manager (or other onsite MDM) instance under monitoring however, you can check for reachability at intervals, and have the troubleshooting done for you.

Thus, I have added my APNS reachability script to OSX-Monitoring-Tools. It can be used to ensure that monitored systems can see and connect to Apple’s APNS provider servers, and that clients can connect to receive notifications within the network.

OSX-Monitoring-Tools 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