Page 1 of 1

Nagios suddenly stopped working

Posted: Sun Nov 29, 2020 5:25 pm
by dbpinochle
This software was working like a champ until suddenly it didn't. I had added a couple of new hosts so like any good user I commented them out one by one, even those that had worked fine before Here is some information:

RPI 4
pi@raspberrypi:/usr/local/nagios/etc $ free -h
total used free shared buff/cache available
Mem: 855Mi 197Mi 312Mi 45Mi 344Mi 653Mi
Swap: 99Mi 1.0Mi 98Mi
pi@raspberrypi:/usr/local/nagios/etc $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Error when start
pi@raspberrypi:/usr/local/nagios/etc $ sudo systemctl start nagios
Job for nagios.service failed because the control process exited with error code.
See "systemctl status nagios.service" and "journalctl -xe" for details.
portion of nagios.cfg
# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg
#cfg_file=/usr/local/nagios/etc/objects/db1.cfg
#cfg_file=/usr/local/nagios/etc/objects/speed1.cfg
#cfg_file=/usr/local/nagios/etc/objects/kismet1.cfg
#cfg_file=/usr/local/nagios/etc/objects/boinc1.cfg
#cfg_file=/usr/local/nagios/etc/objects/cloudflare1.cfg
#cfg_file=/usr/local/nagios/etc/objects/cloudflare2.cfg
#cfg_file=/usr/local/nagios/etc/objects/kodi.cfg
pi@raspberrypi:/usr/local/nagios/etc $ sudo systemctl status nagios
● nagios.service - Nagios Core 4.4.6
Loaded: loaded (/lib/systemd/system/nagios.service; enabled; vendor preset: e
Active: failed (Result: exit-code) since Sun 2020-11-29 13:57:44 PST; 16min a
Docs: https://www.nagios.org/documentation
Process: 2171 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/e
Process: 2172 ExecStopPost=/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (cod

Nov 29 13:57:44 raspberrypi nagios[2171]: ***> One or more problems was encounte
Nov 29 13:57:44 raspberrypi nagios[2171]: Check your configuration file(s)
Nov 29 13:57:44 raspberrypi nagios[2171]: directives and data definitions.
Nov 29 13:57:44 raspberrypi nagios[2171]: version of Nagios, you should be
Nov 29 13:57:44 raspberrypi nagios[2171]: may have been removed or modified
Nov 29 13:57:44 raspberrypi nagios[2171]: the HTML documentation regarding
Nov 29 13:57:44 raspberrypi nagios[2171]: 'Whats New' section to find out w
Nov 29 13:57:44 raspberrypi systemd[1]: nagios.service: Control process exited,
Nov 29 13:57:44 raspberrypi systemd[1]: nagios.service: Failed with result 'exit
Nov 29 13:57:44 raspberrypi systemd[1]: Failed to start Nagios Core 4.4.6.
I have no idea what could have changed. I know this must be simple but direction would be appreciated.

Thanks for helping

Re: Nagios suddenly stopped working

Posted: Sun Nov 29, 2020 6:48 pm
by scottwilkerson
Looks like you have a problem with your configuration, what is the output of

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Re: Nagios suddenly stopped working

Posted: Mon Nov 30, 2020 12:53 pm
by dbpinochle
pi@raspberrypi:~ $ sudo /usr/local/nagios/bin/nagios -v /usr/local/nabvios/etc/nagios.cfg

Nagios Core 4.4.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2020-04-28
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Error: Cannot open main configuration file '/usr/local/nabvios/etc/nagios.cfg' for reading!
I guess it is a permissions error?
pi@raspberrypi:/usr/local/nagios/etc $ ls -al
total 84
drwxrwxr-x 3 nagios nagios 4096 Nov 29 14:13 .
drwxr-xr-x 8 root root 4096 Nov 3 11:26 ..
-rw-rw-r-- 1 nagios nagios 13710 Nov 3 11:26 cgi.cfg
-rw-r--r-- 1 root root 50 Nov 3 11:29 htpasswd.users
-rw-rw-r-- 1 nagios nagios 46253 Nov 29 13:45 nagios.cfg
drwxrwxr-x 2 nagios nagios 4096 Nov 29 13:39 objects
-rw-rw---- 1 nagios nagios 1312 Nov 3 11:26 resource.cfg

Re: Nagios suddenly stopped working

Posted: Mon Nov 30, 2020 3:43 pm
by dbpinochle
Thanks, Scott.

Uh, ya, one of the object configuration files has incorrect information. Sorry

Re: Nagios suddenly stopped working

Posted: Mon Nov 30, 2020 3:45 pm
by scottwilkerson
dbpinochle wrote:Thanks, Scott.

Uh, ya, one of the object configuration files has incorrect information. Sorry
Glad it is resolved

Locking thread