Page 1 of 1

Nagios Core - Not Running

Posted: Fri Jun 16, 2017 12:05 pm
by Morty79
Hi Folks,

First time poster here. I've been working on a Cacti/Nagios Core server for the last couple days. Cacti is running and graphing for the most part but Nagios has been causing me some issues.

I have tried a few different things to get it running but I have been unsuccesful thus far.

Here it goes.

When i bring up the Nagios page it asks me for the un and pw. Logging in with the nagiosadmin account works fine.
However, the page says NAGIOS CORE x Not Running
If i click on Tactical Overview I get 'Error: Could not read object configuration data!'

Im running
CentOS 7
Nagios Core 4.2.4
NET-SNMP 5.7.2
PHP 5.4.16
Apache 2.4.6

Test on Nagios Cofig shows this:
[root@nms logs]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.3.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-05-09
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Could not get passwd entry for 'nagios'
Warning: Could not set effective UID=-1


systmctl status shows:
[root@nms logs]# systemctl status nagios.service
● nagios.service - Nagios Network Monitoring
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2017-06-16 12:37:56 EDT; 24min ago
Docs: https://www.nagios.org/documentation/
Process: 3737 ExecStartPre=/usr/sbin/nagios -v /etc/nagios/nagios.cfg (code=exited, status=217/USER)

Jun 16 12:37:56 nms.cruickshank.local systemd[1]: Starting Nagios Network Monitoring...
Jun 16 12:37:56 nms.cruickshank.local systemd[1]: nagios.service: control process exited, code=exited status=217
Jun 16 12:37:56 nms.cruickshank.local systemd[1]: Failed to start Nagios Network Monitoring.
Jun 16 12:37:56 nms.cruickshank.local systemd[1]: Unit nagios.service entered failed state.
Jun 16 12:37:56 nms.cruickshank.local systemd[1]: nagios.service failed.

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 12:21 pm
by dwhitfield
Is it possible you have two different versions of Core installed? You report 4.2.4 but the output reports 4.3.2. Could you send a screenshot of your screen?

What's the output of rpm -qa | grep nagios? Please put the output in a code block. The "Code" button is the fifth from the left on the post input screen (between Quote and List).

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 12:34 pm
by Morty79
Is it possible I have 2 versions...Yes. I tried using an online guide first. It didnt go so well. (that's likely where there 4.3.2 came from)
Then I tried just installing everything via YUM. That is likely where the 4.2.4 came from.

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 12:35 pm
by Morty79
[root@nms logs]# rpm -qa | grep nagios
nagios-common-4.2.4-2.el7.x86_64
nagios-plugins-flexlm-2.1.4-2.el7.x86_64
nagios-plugins-mailq-2.1.4-2.el7.x86_64
nagios-plugins-ntp-2.1.4-2.el7.x86_64
nagios-plugins-by_ssh-2.1.4-2.el7.x86_64
nagios-plugins-oracle-2.1.4-2.el7.x86_64
nagios-plugins-swap-2.1.4-2.el7.x86_64
nagios-plugins-procs-2.1.4-2.el7.x86_64
nagios-plugins-ping-2.1.4-2.el7.x86_64
nagios-plugins-rpc-2.1.4-2.el7.x86_64
nagios-plugins-disk_smb-2.1.4-2.el7.x86_64
nagios-plugins-cluster-2.1.4-2.el7.x86_64
nagios-plugins-ups-2.1.4-2.el7.x86_64
nagios-plugins-dns-2.1.4-2.el7.x86_64
nagios-plugins-nt-2.1.4-2.el7.x86_64
nagios-plugins-2.1.4-2.el7.x86_64
nagios-4.2.4-2.el7.x86_64
nagios-plugins-perl-2.1.4-2.el7.x86_64
nagios-plugins-file_age-2.1.4-2.el7.x86_64
nagios-plugins-breeze-2.1.4-2.el7.x86_64
nagios-plugins-wave-2.1.4-2.el7.x86_64
nagios-plugins-ide_smart-2.1.4-2.el7.x86_64
nagios-plugins-mysql-2.1.4-2.el7.x86_64
nagios-plugins-ldap-2.1.4-2.el7.x86_64
nagios-plugins-pgsql-2.1.4-2.el7.x86_64
nagios-plugins-overcr-2.1.4-2.el7.x86_64
nagios-plugins-nwstat-2.1.4-2.el7.x86_64
nagios-plugins-disk-2.1.4-2.el7.x86_64
nagios-plugins-users-2.1.4-2.el7.x86_64
nagios-plugins-sensors-2.1.4-2.el7.x86_64
nagios-plugins-fping-2.1.4-2.el7.x86_64
nagios-plugins-dummy-2.1.4-2.el7.x86_64
nagios-plugins-ntp-perl-2.1.4-2.el7.x86_64
nagios-plugins-smtp-2.1.4-2.el7.x86_64
nagios-plugins-snmp-2.1.4-2.el7.x86_64
nagios-plugins-time-2.1.4-2.el7.x86_64
nagios-plugins-dhcp-2.1.4-2.el7.x86_64
nagios-plugins-nagios-2.1.4-2.el7.x86_64
nagios-plugins-dig-2.1.4-2.el7.x86_64
nagios-plugins-log-2.1.4-2.el7.x86_64
nagios-plugins-http-2.1.4-2.el7.x86_64
nagios-plugins-all-2.1.4-2.el7.x86_64
nagios-plugins-ircd-2.1.4-2.el7.x86_64
nagios-plugins-mrtgtraf-2.1.4-2.el7.x86_64
nagios-plugins-hpjd-2.1.4-2.el7.x86_64
nagios-plugins-load-2.1.4-2.el7.x86_64
nagios-plugins-real-2.1.4-2.el7.x86_64
nagios-plugins-tcp-2.1.4-2.el7.x86_64
nagios-plugins-ssh-2.1.4-2.el7.x86_64
nagios-plugins-icmp-2.1.4-2.el7.x86_64
nagios-plugins-game-2.1.4-2.el7.x86_64
nagios-plugins-mrtg-2.1.4-2.el7.x86_64
nagios-devel-4.2.4-2.el7.x86_64

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 1:21 pm
by dwhitfield
It's probably going to be easier to yum remove nagios-common that it is to remove the compiled version without touching the yum repo.

Do you know at what point you had trouble with the compilation instructions? Were https://support.nagios.com/kb/article.php?id=96#CentOS the instructions you used? If not, can you run through those and see if you get better results?

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 1:26 pm
by tgriep
It looks line the nagios user account is missing and that could be the reason the command is failing.
Try running the following as root to create the user account and the nagios group.

Code: Select all

useradd nagios
usermod -a -G nagios apache
After that, see if the nagios daemon will start.

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 1:37 pm
by Morty79
Following the steps on that link:

[root@nms nagioscore-nagios-4.3.2]# systemctl enable nagios.service
nagios.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig nagios on

Is that right?

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 1:56 pm
by cdienger
That ouput is okay and expected. It just means the nagios service isn't using systemd and systemd is smart enough to redirect to chkconfig.

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 2:09 pm
by Morty79
Looks like that fixed it up.

I can login and everything on the localhost is GREEN except for HTTP (Yellow warning) ?

Thanks for the help on the install. Been several years since I setup Nagios.

Re: Nagios Core - Not Running

Posted: Fri Jun 16, 2017 2:13 pm
by cdienger
Glad to help : ) We'll lock this up. Feel free to post again if you need anything else!