Page 1 of 2

Installing Nagios on Centos 6.4

Posted: Tue Nov 26, 2013 4:12 pm
by Dave
Hi, I have followed the post on installing Nagios Core from source. It all installs ok with no errors but cannot access the web interface. The processes are all started. Can any one point me in the right direction.

Many thanks

Re: Installing Nagios on Centos 6.4

Posted: Tue Nov 26, 2013 4:20 pm
by tmcdonald
Are you trying to access the interface locally or remotely? Is there a firewall in place blocking you? What is displayed in the web browser when you try to view the page?

Re: Installing Nagios on Centos 6.4

Posted: Sun Dec 01, 2013 10:07 pm
by brian_s
I'm wondering if this is an issue with apache2's virtual host configuration.

I'm having the same problem, but on Ubuntu 13. I have installed from source per instructions found on a google search, and it all appears to be working. However, when I visit the page (http://internalserveraddress/nagios) I get an error saying it's not found on the host. I believe there may be a very fundamental step missing in the configuration of apache's virtual host in the documentation/instructions.

Can anyone help?

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 12:24 pm
by sreinhardt
I would agree, that sounds like apaches vhost setup is not complete, and potentially your permissions on the cgi files that apache would call. Can you provide the guides that you have been using please?

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 1:46 pm
by brian_s
sreinhardt wrote:I would agree, that sounds like apaches vhost setup is not complete, and potentially your permissions on the cgi files that apache would call. Can you provide the guides that you have been using please?

I would like to use something from Nagios, however it is severely outdated. I am using a guide from Ubuntu Geek found at http://www.ubuntugeek.com/how-to-instal ... ander.html. This guide is out of date with the 4.0.2 update because of the service "hack" involved. Still, it would be nice to know how to get the 4.0.1 up and going and learn how to setup proper vhost and permissions through this process.

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 2:07 pm
by lmiltchev
You can check out the following tutorial, posted on the Nagios Exchange:

http://exchange.nagios.org/directory/Tu ... at/details

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 2:07 pm
by abrist
After you installed the source, did you install the webconf? If not, change directory to the nagios source directory, and run "make install-webconf":

Code: Select all

cd /path/to/nagios/source
make install-webconf
Then restart httpd:

Code: Select all

service httpd restart

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 4:56 pm
by brian_s
lmiltchev wrote:You can check out the following tutorial, posted on the Nagios Exchange:

http://exchange.nagios.org/directory/Tu ... at/details
Completed this install. I've never used CentOS before, but I have accomplished more here than with Ubuntu. However, if I click ANY links other than the "Home" link, I get a "The server encountered an internal error or misconfiguration and was unable to complete your request."

Any suggestions on where to look from here? By the way, thanks for the help!!!!!


**** EDIT ****

Here are the last few lines from my httpd error_log:

[Mon Dec 02 09:50:01 2013] [error] [client 172.16.0.23] PHP Warning: date(): It is not safe to rely on the system's timezone settings$
[Mon Dec 02 09:50:15 2013] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 02 09:50:19 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed, ref$
[Mon Dec 02 09:50:19 2013] [error] [client 172.16.0.23] Premature end of script headers: status.cgi, referer: http://172.16.0.81/nagio$
[Mon Dec 02 09:50:49 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/config.cgi' failed, ref$
[Mon Dec 02 09:50:49 2013] [error] [client 172.16.0.23] Premature end of script headers: config.cgi, referer: http://172.16.0.81/nagio$
[Mon Dec 02 09:50:49 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/config.cgi' failed, ref$
[Mon Dec 02 09:50:49 2013] [error] [client 172.16.0.23] Premature end of script headers: config.cgi, referer: http://172.16.0.81/nagio$
[Mon Dec 02 09:50:51 2013] [error] [client 172.16.0.23] PHP Warning: date(): It is not safe to rely on the system's timezone settings$
[Mon Dec 02 09:51:15 2013] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 02 09:51:49 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/tac.cgi' failed, refere$
[Mon Dec 02 09:51:49 2013] [error] [client 172.16.0.23] Premature end of script headers: tac.cgi, referer: http://172.16.0.81/nagios/s$
[Mon Dec 02 09:53:39 2013] [error] [client 172.16.0.23] PHP Warning: date(): It is not safe to rely on the system's timezone settings$
[Mon Dec 02 09:53:43 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/tac.cgi' failed, refere$
[Mon Dec 02 09:53:43 2013] [error] [client 172.16.0.23] Premature end of script headers: tac.cgi, referer: http://172.16.0.81/nagios/s$
[Mon Dec 02 09:53:57 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/tac.cgi' failed
[Mon Dec 02 09:53:57 2013] [error] [client 172.16.0.23] Premature end of script headers: tac.cgi
[Mon Dec 02 09:53:57 2013] [error] [client 172.16.0.23] File does not exist: /var/www/html/favicon.ico, referer: http://172.16.0.81/na$
[Mon Dec 02 09:56:15 2013] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon Dec 02 09:56:16 2013] [error] [client 172.16.0.23] PHP Warning: date(): It is not safe to rely on the system's timezone settings$
[Mon Dec 02 09:56:20 2013] [error] [client 172.16.0.23] (13)Permission denied: exec of '/usr/local/nagios/sbin/extinfo.cgi' failed, re$
[Mon Dec 02 09:56:20 2013] [error] [client 172.16.0.23] Premature end of script headers: extinfo.cgi, referer: http://172.16.0.81/nagi$
[Mon Dec 02 10:01:15 2013] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 5:10 pm
by abrist
Are you running selinux?

Code: Select all

getenforce
If so, disable it with:

Code: Select all

setenforce 0
And to make the changes persist through reboot:
Edit:

Code: Select all

/etc/sysconfig/selinux
Change:

Code: Select all

SELINUX=enforcing
To:

Code: Select all

SELINUX=disabled

Re: Installing Nagios on Centos 6.4

Posted: Mon Dec 02, 2013 5:13 pm
by brian_s
That did it!!! I just read it on another forum entry. Thanks,all, for the help!!!