Installing Nagios on Centos 6.4

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.
Dave
Posts: 1
Joined: Tue Nov 26, 2013 3:50 pm

Installing Nagios on Centos 6.4

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Installing Nagios on Centos 6.4

Post 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?
Former Nagios employee
brian_s
Posts: 5
Joined: Sun Dec 01, 2013 10:01 pm

Re: Installing Nagios on Centos 6.4

Post 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?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Installing Nagios on Centos 6.4

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
brian_s
Posts: 5
Joined: Sun Dec 01, 2013 10:01 pm

Re: Installing Nagios on Centos 6.4

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Installing Nagios on Centos 6.4

Post by lmiltchev »

You can check out the following tutorial, posted on the Nagios Exchange:

http://exchange.nagios.org/directory/Tu ... at/details
Be sure to check out our Knowledgebase for helpful articles and solutions!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Installing Nagios on Centos 6.4

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
brian_s
Posts: 5
Joined: Sun Dec 01, 2013 10:01 pm

Re: Installing Nagios on Centos 6.4

Post 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/
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Installing Nagios on Centos 6.4

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
brian_s
Posts: 5
Joined: Sun Dec 01, 2013 10:01 pm

Re: Installing Nagios on Centos 6.4

Post by brian_s »

That did it!!! I just read it on another forum entry. Thanks,all, for the help!!!
Locked