Red X Not Running sfter install 4.2.4 Nagios Core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ScottJacobs
Posts: 4
Joined: Mon Jan 30, 2017 3:11 pm

Red X Not Running sfter install 4.2.4 Nagios Core

Post by ScottJacobs »

I went through the quickstart installation guide and everything looked good. But when I log onto the web browser for my Nagios installation I see a red X Not Running error on the main page.

When I do a check with the -v there shows no warning and no errors

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check


When I look at the nagios.log file I see that Core can't read the config file

[1485814400] Error: Cannot open main configuration file '/usr/local/nagios/etc/nagios.cfg:' for reading!
[1485814400] Error: Failed to process config file '/usr/local/nagios/etc/nagios.cfg:'. Aborting
[1485817944] Error: Cannot open main configuration file '/usr/local/nagios/etc/nagios.cfg:' for reading!
[1485817944] Error: Failed to process config file '/usr/local/nagios/etc/nagios.cfg:'. Aborting


Permissions are set to 777 for this file. (nagios.cfg)

I am running a Raspberry PI 3 model B with Raspbian Jesse with Pixel - latest download.

I went through all the steps and had no errors, I was hoping someone might have an idea for me to try to get this up and running, a permissions error or something maybe?
Last edited by dwhitfield on Wed Feb 01, 2017 4:10 pm, edited 1 time in total.
Reason: marking with green check mark
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Red X Not Running sfter install 4.2.4 Nagios Core

Post by dwhitfield »

The first step at https://support.nagios.com/kb/article.php?id=96 is to disable SELinux. Did you do that?

Do you have an old repo version of Core installed? It's possible Core is trying to find the nagios.cfg from the repo version.

We might as well go ahead and take a look at ls -la /usr/local/nagios/etc/.
ScottJacobs
Posts: 4
Joined: Mon Jan 30, 2017 3:11 pm

Re: Red X Not Running sfter install 4.2.4 Nagios Core

Post by ScottJacobs »

Okay, doing what you suggest:

This is the check for old versions of Core

root@raspberrypi:~# ls -la /usr/local/nagios/etc/
total 204
drwxrwsr-x 3 nagios nagios 4096 Jan 30 14:22 .
drwxrwsrwx 10 root staff 4096 Jan 30 16:05 ..
-rw-rw-r-- 1 nagios nagios 12744 Jan 30 13:50 cgi.cfg
-rwxrwxrwx 1 nagios nagios 12267 Jan 27 16:06 cgi.cfg~
-rwxrwxrwx 1 root nagios 50 Jan 30 13:54 htpasswd.users
-rwxrwxrwx 1 nagios nagios 44831 Jan 30 17:12 nagios.cfg
-rwxrwxrwx 1 pi pi 44649 Jan 30 13:31 nagios.cfg~
-rwxrwxrwx 1 nagios nagios 44835 Jan 30 07:12 nagios.cfg.old
-rwxrwxrwx 1 root nagios 16384 Jan 27 16:56 .nagios.cfg.swp
drwxrwsr-x 2 nagios nagios 4096 Jan 30 13:50 objects
-rw-rw---- 1 nagios nagios 1312 Jan 30 13:50 resource.cfg
-rwxrwxrwx 1 nagios nagios 1312 Jan 27 16:06 resource.cfg~




This was the result from the SELinux check

root@raspberrypi:~# dpkg -l selinux*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-============================-===================-===================-==============================================================
un selinux-policy-default <none> <none> (no description available)




This is now the result from the SELinux check

root@raspberrypi:~# dpkg -l selinux*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-============================-===================-===================-==============================================================
ii selinux-basics 0.5.2 all SELinux basic support
ii selinux-policy-default 2:2.20140421-7 all Strict and Targeted variants of the SELinux policy
ii selinux-policy-dev 2:2.20140421-7 all Headers from the SELinux reference policy for building modules
ii selinux-policy-doc 2:2.20140421-7 all Documentation for the SELinux reference policy
ii selinux-policy-mls 2:2.20140421-7 all MLS (Multi Level Security) variant of the SELinux policy
un selinux-policy-refpolicy-doc <none> <none> (no description available)
ii selinux-policy-src 2:2.20140421-7 all Source of the SELinux reference policy for customization
ii selinux-utils 2.3-2 armhf SELinux utility programs


and when I try to run the command

a2enmod cgi

I get this error:

ERROR: Module cgi does not exist!


Thank you for the help!
ScottJacobs
Posts: 4
Joined: Mon Jan 30, 2017 3:11 pm

Re: Red X Not Running sfter install 4.2.4 Nagios Core

Post by ScottJacobs »

Thank you dwhitfield for your assistance with my Nagios installation issues. I figured out the problem!

My log file was saying that it couldn't load /usr/local/etc/nagios.cfg but I missed that inside the quotes was nagios.cfg:

I renamed the nagios.cfg file to nagios.cfg: and it loaded and is working fine!

Log file after config file rename

[1485883031] Error: Failed to process config file '/usr/local/nagios/etc/nagios.cfg:'. Aborting
[1485883263] Error: Cannot open main configuration file '/usr/local/nagios/etc/nagios.cfg:' for reading!
[1485883263] Error: Failed to process config file '/usr/local/nagios/etc/nagios.cfg:'. Aborting
[1485888269] Nagios 4.2.4 starting... (PID=1620)
[1485888269] Local time is Tue Jan 31 12:44:29 CST 2017
[1485888269] LOG VERSION: 2.0
[1485888269] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1485888269] qh: core query handler registered
[1485888269] nerd: Channel hostchecks registered successfully
[1485888269] nerd: Channel servicechecks registered successfully
[1485888269] nerd: Channel opathchecks registered successfully
[1485888269] nerd: Fully initialized and ready to rock!
[1485888269] wproc: Successfully registered manager as @wproc with query handler
[1485888269] wproc: Registry request: name=Core Worker 1622;pid=1622
[1485888269] wproc: Registry request: name=Core Worker 1626;pid=1626
[1485888269] wproc: Registry request: name=Core Worker 1627;pid=1627
[1485888269] wproc: Registry request: name=Core Worker 1624;pid=1624
[1485888269] wproc: Registry request: name=Core Worker 1623;pid=1623
[1485888269] wproc: Registry request: name=Core Worker 1625;pid=1625
[1485888269] Successfully launched command file worker with pid 1628


This is now working

Thank you
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Red X Not Running sfter install 4.2.4 Nagios Core

Post by rkennedy »

Awesome - are we good to mark this thread resolved?
Former Nagios Employee
ScottJacobs
Posts: 4
Joined: Mon Jan 30, 2017 3:11 pm

Re: Red X Not Running sfter install 4.2.4 Nagios Core

Post by ScottJacobs »

Yes
Locked