Monitoring the Nagios process with monit
Monitoring the Nagios process with monit
Howto to install monit on Debian or Ubuntu to monitor the nagios process.
Installation
aptitude install monit
Configuration
Edit the monit configuration file /etc/monit/monitrc and make the following changes:
Generall settings:
set daemon 120
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: monit@myserver.de }
set alert admin@myserver.de
Check the nagios process:
check process nagios3 with pidfile /var/run/nagios3/nagios3.pid
start program = "/etc/init.d/nagios3 start"
stop program = "/etc/init.d/nagios3 stop"
if 3 restarts within 3 cycles then timeout
If nagios is not running, monit tries to start it 3 times. And send you an e-mail.
Note: If you use Centreon the pid file is /var/lib/nagios3/nagios.lock . You have to replace it in the monit configuration file or change the „Lock File“ value in your centreon configuration.
Change the following value in /etc/default/monit to:
startup=1
Start monit
/etc/init.d/monit start
Links
* M/Monit
* Monitor Debian servers with monit
* Nagios
* Centreon
System Administrator Appreciation Day !!!!! Extract images from .vob (photo cd) with Ubuntu or Debian

I prefer to use zabbix for monitoring servers but just sorted monit on some ubuntu laptops now 🙂