Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1


Remember Me

Directory Tree


0 votes
check_osx_services-1.1.zipcheck_osx_services v. 1.1
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
check_osx_services uses the serveradmin command built in to OS X Server to check to see if various services are running and (optionally) to set warning and critical thresholds.
This script is typically run via NRPE and utilizes the 'serveradmin' command line
tool that's included with OS X Server to check the status of various built-in
services such as AFP, QuickTime Streaming Server, and DHCP. Since serveradmin
requires root privileges, this script uses sudo to allow the nagios user to execute
the script. See the sample nrpe.cfg file for instructions on adding the nagios
user to the sudoers file.

First add a check command to nrpe.cfg. For example:

commandcheck_afp=sudo /opt/local/libexec/nagios/check_osx_services -s afp

The script will check against warning and critical thresholds for services where it
makes sense to do so. For OS 10.4 those services that accept -w and -c switches are:

afp, smb, qtss, ftp, and jabber -- number of current connections
dhcp -- number of current leases
print -- number of current print jobs
web -- total KBytes

The use of -w and -c switches for these services is optional. If they are not provided,
the check will simply return OK or CRITICAL based on whether the service is running.

Typical usage:

$ ./check_osx_services -s afp -w 10 -c 20
afp: Started - Uptime: 6 hrs 5.30 mins, 0 Connections

$ ./check_osx_service -s web
web: Started - 3519 Total requests, 15564 Total kB

$ ./check_osx_services -s swupdate
swupdate: Started - Uptime: 6 hrs 4.98 mins, Last check: Mon Jan 14 20:53:56 2008

To get a list of available services use the -l switch

$ ./check_osx_services -l
... (and so on)