We were looking for a solution to monitor the apple and other equipment of our customers. All our customers have heterogenous environments, so the Apple monitoring features were not an option. The customers wanted to have an overview over the whole equipment. We came across the open source network monitor Nagios. You can monitor almost every piece of hardware with it, either by executing check scripts on a remote machine, or query the services directly from the Nagios server via snmp.
We did the setup of the Nagios server according to this howto for Macintosh. There were no Plugins for the Apple Hardware or Xsan, so we wrote our own Plugins and published them on our website.
- check_apple_xsan monitors your Xsan
- check_apple_xserve can monitor your Xserve Hardware.
The plugins need a NRPE (Nagios remote program executor) daemon running on the monitored host, and also on the Nagios server. You can install the NRPE daemon, if you followed the instructions from the Nagios install howto by typing:
sudo port install nrpe
At this stage you can also install a free plugin for monitoring the Apple Xserve Raids.
sudo port install xserve-raid-tools
Unpack and put the plugins for Xsan and the Xserves into the libexec directory in /opt/local/libexec/nagios on the monitored hosts.
To get the Nagios server and monitored machine to communicate with each other you have to edit some config files on the monitored machine. Edit /opt/local/etc/nrpe/nrpe.cfg and add the following lines:
command[check_apple_xsan]=/opt/local/libexec/nagios/check_apple_xsan
command[check_apple_xserve]=/opt/local/libexec/nagios/check_apple_xserve
Then restart the NRPE daemon from the command line:
sudo /opt/local/etc/LaunchDaemons/org.macports.nrpe/nrpe.wrapper restart
You can test it from the nagios server if the plugin works:
/opt/local/libexec/nagios/check_nrpe -H HOST_ADDRESS -c check_apple_xserve
If it works you will only have to automate the checks by adding them to the config file on the Nagios server. By default the config file is /opt/local/etc/nagios/localhost.cfg. The syntax can vary very much depending on your needs and environment, so I will only post an example what a service description can look like:
define service {
hostgroup_name AppleServers
service_description check apple xserve
check_command check_nrpe!check_apple_xserve
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
check_period 24x7
contact_groups Consol
notification_interval 30
notification_period 24x7
}
The check_command tells the Nagios server to use the plugin check_nrpe to execute the plugin check_apple_xserve on the hosts in the hostgroup AppleServers. It notifies the contact group Consol 24x7 if any problems occur.
Maybe that helps you to monitor you whole environment and see the problems before your users do it.

