Home > HowTo, Linux, Nagios > Nagios will not start

Nagios will not start

Nagios will not start

Sometimes for strange reason nagios will not start. It happened to me more then once, sometimes I had to go back to the last modification. That is why I do a daily backup of all .cfg, here is how

1.Check if the nagios.cfg is ok
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Any errors here MUST be fixed or nagios will not start

2.Check the file permissions
Are the .cfg permissions ok for user nagios?

3.Call nagios start in verbose mode
# bash -x /etc/init.d/nagios start

(nagios ver 3.0.3 output)
+ kconfig: 345 99 01
/etc/init.d/nagios: line 1: kconfig:: command not found
+ ‘[‘ -f /etc/rc.d/init.d/functions ‘]’
+ ‘[‘ -f /etc/init.d/functions ‘]’
+ prefix=/usr/local/nagios
+ exec_prefix=/usr/local/nagios
+ NagiosBin=/usr/local/nagios/bin/nagios
+ NagiosCfgFile=/usr/local/nagios/etc/nagios.cfg
+ NagiosStatusFile=/usr/local/nagios/var/status.dat
+ NagiosRetentionFile=/usr/local/nagios/var/retention.dat
+ NagiosCommandFile=/usr/local/nagios/var/rw/nagios.cmd
+ NagiosVarDir=/usr/local/nagios/var
+ NagiosRunFile=/usr/local/nagios/var/nagios.lock
+ NagiosLockDir=/var/lock/subsys
+ NagiosLockFile=nagios
+ NagiosCGIDir=/usr/local/nagios/sbin
+ NagiosUser=nagios
+ NagiosGroup=nagios
+ ‘[‘ ‘!’ -f /usr/local/nagios/bin/nagios ‘]’
+ ‘[‘ ‘!’ -f /usr/local/nagios/etc/nagios.cfg ‘]’
+ case “$1” in
+ echo -n ‘Starting nagios:’
Starting nagios:+ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
+ ‘[‘ 0 -eq 0 ‘]’
+ su – nagios -c ‘touch /usr/local/nagios/var/nagios.log /usr/local/nagios/var/retention.dat’
+ rm -f /usr/local/nagios/var/rw/nagios.cmd
+ touch /usr/local/nagios/var/nagios.lock
+ chown nagios:nagios /usr/local/nagios/var/nagios.lock
+ /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
+ ‘[‘ -d /var/lock/subsys ‘]’
+ echo ‘ done.’
done.
+ exit 0

4.Check processes are running
# ps ax | grep nagios
Remember about NDO errors, check this page for more information

  1. No comments yet.
  1. No trackbacks yet.

VAMOVE *

*