Nagios web interface not available on Cpanel server

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.
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Nagios web interface not available on Cpanel server

Post by jasgot »

I have a new install of Nagios Core and it appears to be running, but I cannot access the web interface from my location.

The install is on my dedicated server at a hosting center running:
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
with WHM/Cpanel

Nagios is installed in:
/usr/local/nagios

The Nagios subdomain is nagios.xxx.com or xxx.com/nagios

SELinux is disabled:
[root@server ~]# sestatus
SELinux status: disabled
[root@server ~]# getenforce
Disabled
[root@server ~]#

The Vhost section of my httpd.conf is:
<VirtualHost 1.2.3.4:80>
ServerName nagios.xxx.com
ServerAlias http://www.nagios.xxx.com
DocumentRoot /sites/xxx/public_html/nagios
ServerAdmin [email protected]
UseCanonicalName On
CustomLog /usr/local/apache/domlogs/nagios.xxx.com combined
CustomLog /usr/local/apache/domlogs/nagios.sxxxyo.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User xxx# Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled xxx
<IfModule mod_suphp.c>
suPHP_UserGroup nagios nagios
</IfModule>
<IfModule concurrent_php.c>
php4_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
php5_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule !concurrent_php.c>
<IfModule mod_php4.c>
php_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/sites/xxx:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
</IfModule>
<IfModule !mod_disable_suexec.c>
<IfModule !mod_ruid2.c>
SuexecUserGroup nagios nagios
</IfModule>
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid nagios nagios
</IfModule>
<IfModule itk.c>
# For more information on MPM ITK, please read:
# http://mpm-itk.sesse.net/
AssignUserID xxx xxx
</IfModule>

ScriptAlias /cgi-bin/ /sites/xxx/public_html/nagios/cgi-bin/

Include "/usr/local/apache/conf/userdata/std/2/xxx/nagios.xxx.com/*.conf"
</VirtualHost>




My /usr/local/apache/conf/userdata/std/2/xxx/nagios.xxx.com/*.conf file is called nagios.conf and its contents are:
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
Options ExecCGI
AllowOverride AuthConfig
Order allow,deny
#Allow from 10.0.0.0/24
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
Options None
AllowOverride AuthConfig
Order allow,deny
#Allow from 10.0.0.0/24
</Directory>



I find that when I check to see if nagios is running with "service nagios status" it is not running,
When I start it, it does run. Maybe it stops when I restart httpd?


I've spent hours and hours on this and cannot find the problem.

Thanks for any assistance you can provide.
Last edited by jasgot on Sun Feb 15, 2015 2:39 pm, edited 1 time in total.
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Re: Nagios web interface not available on Cpanel server

Post by jasgot »

Here the Apache log entries I see:
[Sat Feb 14 20:05:57 2015] [error] [client 68.84.164.49] File does not exist: /sites/xxx/public_html/nagios/nagios
[Sat Feb 14 20:05:57 2015] [error] [client 68.84.164.49] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios web interface not available on Cpanel server

Post by Box293 »

Did you follow a guide to install Core? Can you provide a link to it?

What version of Core?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Re: Nagios web interface not available on Cpanel server

Post by jasgot »

Box293 wrote:Did you follow a guide to install Core? Can you provide a link to it?

What version of Core?
I followed this guide, but while troubleshooting, I strayed away from some of the settings. But I did get them all put back.
http://kmaiti.blogspot.com/2010/09/how- ... el-or.html

Nagios 4.0.8

Thanks.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios web interface not available on Cpanel server

Post by abrist »

It looks like you ahve 2 script aliases pointing to 2 different locations for the nagios cgi-bin directory:

Code: Select all

ScriptAlias /cgi-bin/ /sites/xxx/public_html/nagios/cgi-bin/
And:

Code: Select all

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
Judging by the error:

Code: Select all

File does not exist: /sites/xxx/public_html/nagios/nagios
I would guess apache is using the first definition.

In which location did you install the cgi files to?
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.
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Re: Nagios web interface not available on Cpanel server

Post by jasgot »

In which location did you install the cgi files to?
Nagios is actually in /usr/local/nagios/

cgi files are in:
/usr/local/nagios/sbin
Last edited by jasgot on Mon Feb 16, 2015 3:41 pm, edited 2 times in total.
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Re: Nagios web interface not available on Cpanel server

Post by jasgot »

Should the nagios.conf that is read as an include override the httpd.conf file?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios web interface not available on Cpanel server

Post by scottwilkerson »

No, it is a config fragment. But your httpd.conf should be including files from the conf.d directory it is placed in /etc/httpd/conf.d.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios web interface not available on Cpanel server

Post by tgriep »

Could you run these commands and post back the output

Code: Select all

grep conf.d /etc/httpd/conf/httpd.conf
grep ServerRoot /etc/httpd/conf/httpd.conf
Be sure to check out our Knowledgebase for helpful articles and solutions!
jasgot
Posts: 19
Joined: Sat Feb 14, 2015 7:52 pm

Re: Nagios web interface not available on Cpanel server

Post by jasgot »

tgriep wrote:Could you run these commands and post back the output

Code: Select all

grep conf.d /etc/httpd/conf/httpd.conf
grep ServerRoot /etc/httpd/conf/httpd.conf

Code: Select all

[root@sabrina ~]# grep conf.d /etc/httpd/conf/httpd.conf
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
[root@sabrina ~]#
Your second grep returned nothing.
Locked