Page 1 of 1
Web interface fails although service is running
Posted: Thu May 17, 2018 8:47 am
by nloew
I have recently installed Nagios 4.3.4 on a Centos7 server using the
Installing Nagios From Source documentation at support.nagios.com. I had no difficulties with the installation and, after getting no serious errors on my script preflight check, went to localhost/nagios to ensure everything was working. However, according to the web interface the Nagios core is not running.
According to
systemctl, both the Nagios and HTTPD services are running without issue. I have restarted these services multiple times since receiving this error yesterday afternoon, as well as the server upon which they reside, to no avail. Running
sestatus shows SELinux to be disabled. The permissions/ownership of the nagios files appear to be correct. I even uninstalled/reinstalled Nagios and left the default files in place when I opened localhost/nagios and got the same error.
I am utterly at a loss. Any help anyone can provide would be appreciated.
Re: Web interface fails although service is running
Posted: Thu May 17, 2018 12:38 pm
by scottwilkerson
Just curious besides on the landing page where it says "not running" can you verify if you go to the hosts or services pages, do they list and show being updated?
Re: Web interface fails although service is running
Posted: Thu May 17, 2018 12:50 pm
by nloew
Every page on the interface shows Nagios as being offline and unable to read from configuration data.
I installed a CLI interface and received a similar problem - although it would run, it listed no services or hosts.
Re: Web interface fails although service is running
Posted: Thu May 17, 2018 2:39 pm
by scottwilkerson
Can you show the output of the following
Code: Select all
cat /etc/group|grep nag
ls -al /usr/local/nagios/var/rw
ls -al /usr/local/nagios/var
Re: Web interface fails although service is running
Posted: Thu May 17, 2018 2:43 pm
by nloew
Here you go:
Code: Select all
[root@e108-dev puppet]# cat /etc/group|grep nag
nagios:x:1002:apache
nagcmd:x:1003:
[root@e108-dev puppet]# ls -al /usr/local/nagios/var/rw
total 0
drwxrwsr-x 2 nagios nagios 6 May 17 13:53 .
drwxrwxr-x 5 nagios nagios 63 May 17 14:57 ..
[root@e108-dev puppet]# ls -al /usr/local/nagios/var
total 0
drwxrwxr-x 5 nagios nagios 63 May 17 14:57 .
drwxr-xr-x 8 root root 79 May 17 13:53 ..
drwxrwxr-x 2 nagios nagios 6 May 17 13:53 archives
-rw-r--r-- 1 nagios nagios 0 May 17 14:57 nagios.log
drwxrwsr-x 2 nagios nagios 6 May 17 13:53 rw
drwxr-xr-x 3 root root 26 May 17 13:53 spool
Re: Web interface fails although service is running
Posted: Thu May 17, 2018 3:14 pm
by scottwilkerson
This doesn't look like nagios is running
What is the output of the following 2 commands
Code: Select all
ps-ef|grep bin/nagios
systemctl status nagios
Re: Web interface fails although service is running
Posted: Fri May 18, 2018 5:33 am
by nloew
If it isn't, then I'm getting an even weirder error -
systemctl has been insisting all along Nagios is running.
Code: Select all
# ps -ef|grep bin/nagios
nagios 11330 1 0 May17 ? 00:00:02 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 11331 11330 0 May17 ? 00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios 11332 11330 0 May17 ? 00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios 11333 11330 0 May17 ? 00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios 11334 11330 0 May17 ? 00:00:00 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
nagios 11344 11330 0 May17 ? 00:00:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
root 26050 26029 0 06:28 pts/0 00:00:00 grep --color=auto bin/nagios
Code: Select all
# systemctl status nagios
● nagios.service - Nagios Network Monitoring
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-05-17 14:58:48 EDT; 15h ago
Docs: https://www.nagios.org/documentation/
Process: 11327 ExecStart=/usr/sbin/nagios -d /etc/nagios/nagios.cfg (code=exited, status=0/SUCCESS)
Process: 11326 ExecStartPre=/usr/sbin/nagios -v /etc/nagios/nagios.cfg (code=exited, status=0/SUCCESS)
Main PID: 11330 (nagios)
CGroup: /system.slice/nagios.service
├─11330 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
├─11331 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
├─11332 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
├─11333 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
├─11334 /usr/sbin/nagios --worker /var/spool/nagios/cmd/nagios.qh
└─11344 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
May 17 23:59:59 e108-dev nagios[11330]: CURRENT SERVICE STATE: localhost;Root Partition;CRITICAL;HARD;4;(No output on stdout) stderr...irectory
May 17 23:59:59 e108-dev nagios[11330]: CURRENT SERVICE STATE: localhost;SSH;CRITICAL;HARD;4;(No output on stdout) stderr: execvp(/u...irectory
May 17 23:59:59 e108-dev nagios[11330]: CURRENT SERVICE STATE: localhost;Swap Usage;CRITICAL;HARD;4;(No output on stdout) stderr: ex...irectory
May 17 23:59:59 e108-dev nagios[11330]: CURRENT SERVICE STATE: localhost;Total Processes;CRITICAL;HARD;4;(No output on stdout) stder...irectory
May 18 00:58:48 e108-dev nagios[11330]: Auto-save of retention data completed successfully.
May 18 01:58:48 e108-dev nagios[11330]: Auto-save of retention data completed successfully.
May 18 02:58:48 e108-dev nagios[11330]: Auto-save of retention data completed successfully.
May 18 03:58:48 e108-dev nagios[11330]: Auto-save of retention data completed successfully.
May 18 04:58:48 e108-dev nagios[11330]: Auto-save of retention data completed successfully.
May 18 05:58:48 e108-dev nagios[11330]: Auto-save of retention data completed successfully.
Hint: Some lines were ellipsized, use -l to show in full.
Re: Web interface fails although service is running
Posted: Fri May 18, 2018 7:57 am
by scottwilkerson
You said you followed the guide here
https://support.nagios.com/kb/article/n ... tml#CentOS
However, that guide will not place nagios in /usr/sbin/nagios....... So I am led to believe this is another install possibly from an RPM
I would highly recommend starting again on a clean fresh system, as now there are so many variables you do not know what you are going to get.
Re: Web interface fails although service is running
Posted: Fri May 18, 2018 11:50 am
by nloew
That did it! The server in question is something of a sandbox for testing and someone one must tested a different Nagios install without letting anyone know.
Thank you so much for all your help.
Re: Web interface fails although service is running
Posted: Fri May 18, 2018 12:48 pm
by scottwilkerson
nloew wrote:That did it! The server in question is something of a sandbox for testing and someone one must tested a different Nagios install without letting anyone know.
Thank you so much for all your help.
Glad to hear it is resolved
Locking