check_daemontools_service

OpenFusion has a set of Nagios plugins which include a check_daemontools_plugin. A copy of the specific plugin is also available here.

Installation

Download the plugin:

cd /usr/local/nagios/libexec
wget http://www.productionmonkeys.net/sites/productionmonkeys.net/files/nagios/check_daemontools_service
chmod ugo+x check_daemontools_service
chown nagios:nagios check_daemontools_service

The latest version fo the plugin requires the Nagios::Plugin::Getopt and Nagios::Plugin::Functions modules for Perl be installed:

perl -MCPAN -e shell
install Nagios::Plugin::Getopt
install Nagios::Plugin::Functions
exit

The check command takes the syntax of

check_daemontools_service -s <service> [-c <crit_secs>] [-w <warn_secs>][-v]

. The warning and critical times can be adjusted to your preference. Given that if a daemontools service will have a run time of less than 2 seconds if it hasn't started, the critical time can be set quite low. Edit /usr/local/nagios/etc/nrpe.cfg and add entries for the services you want to check, such as:

command[check_daemon_smtp]=/usr/local/nagios/libexec/check_daemontools_service -s /service/smtp -w 15 -c 5

Restart NRPE
Non-root access to svstat

<code>svstat

must be run as the root user in order to check service status. Edit /etc/sudoers and add an entries for the Nagios user:

nagios ALL=(ALL) NOPASSWD:/usr/local/bin/svstat
nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_daemontools_service

Nagios Server Configuration
Since you should have figured out how to install a Nagios server in the first place, I'm not going to provide you with instructions on how to configure a host or service entry for your mail server other than the syntax for the service check_command would be check_nrpe!check_daemon_smtp

Troubleshooting
My latest install of this had difficulty locating the svstat executable. I ended up creating a symbolic link to it in /usr/bin:

ln -s /usr/local/bin/svstat /usr/bin/svstat

Recent Updates

  • 2 years 2 weeks ago
  • 2 years 2 weeks ago
  • 2 years 2 weeks ago
    php 8.x
  • 2 years 2 weeks ago
    10.6.7
  • 2 years 2 weeks ago
    Drop Centos 5/6 stuff