Web interface time out

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.
rlevick
Posts: 49
Joined: Tue Jan 07, 2014 4:20 pm

Web interface time out

Post by rlevick »

I installed nagios according to the directions here:
http://assets.nagios.com/downloads/nagi ... Source.pdf

Other than the bad command to cd to the nagios directory (should be nagios-4.0.2), I didn't have any issues. Unfortunately I cannot access the web console. I edited the /etc/sysconfig/iptables to allow http traffic (a suggestion in another thread). Nagios and httpd services are both running. Any suggestions?
Here is the edited firewall:
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A INPUT -p tcp --dport http -j ACCEPT
-A INPUT -p tcp --dport https -j ACCEPT
COMMIT
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Web interface time out

Post by abrist »

A few things to check:
Is nagios running?

Code: Select all

service nagios status
Your firewall rules look correct, but lets check with nmap just to be sure:

Code: Select all

nmap localhost
Lets also check the apache logs:

Code: Select all

tail -25 /var/log/httpd/error_log
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.
rlevick
Posts: 49
Joined: Tue Jan 07, 2014 4:20 pm

Re: Web interface time out

Post by rlevick »

Well this isn't good.

[root@localhost ~]# nmap localhost
-bash: nmap: command not found



[Wed Jan 15 11:01:30 2014] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
rlevick
Posts: 49
Joined: Tue Jan 07, 2014 4:20 pm

Re: Web interface time out

Post by rlevick »

I had check this before:
[root@localhost ~]# service nagios status
nagios (pid 1643 1640 1639 1638 1637 1633) is running...
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Web interface time out

Post by abrist »

rlevick wrote:Well this isn't good.

[root@localhost ~]# nmap localhost
-bash: nmap: command not found
Not really, you probably just don't have the package.
For ubuntu/debian systems:

Code: Select all

apt-get install nmap
For centos/rhel:

Code: Select all

yum install nmap
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.
rlevick
Posts: 49
Joined: Tue Jan 07, 2014 4:20 pm

Re: Web interface time out

Post by rlevick »

The nmap install went fine. Thanks for that. What about the error in the httpd log? I still have no web access. Service httpd status shows it is running.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Web interface time out

Post by sreinhardt »

Well, lets start with what OS you are running for this machine, as that will greatly determine where default httpd\apache2 and nagios files will be. Then if you could post the nagios.conf from /etc/httpd/conf.d/ or /etc/apache2/conf.d/ 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.
rlevick
Posts: 49
Joined: Tue Jan 07, 2014 4:20 pm

Re: Web interface time out

Post by rlevick »

It would have been good to state the OS. It's CentOS 6.5. Here is the nagios.conf:

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

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

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Web interface time out

Post by sreinhardt »

Let's list /usr/local/nagios/share just to be sure, basically it seems that you referenced the http://hostname/nagios instead of http://hostname/nagios/index.php, and initially it is not allowing you to go to index.php or that file might not be executable.

Code: Select all

ls -lva /usr/local/nagios/share
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.
rlevick
Posts: 49
Joined: Tue Jan 07, 2014 4:20 pm

Re: Web interface time out

Post by rlevick »

[root@localhost ~]# ls -lva /usr/local/nagios/share
total 80
drwxrwxr-x. 11 nagios nagios 4096 Jan 14 16:02 .
drwxr-xr-x. 8 root root 4096 Jan 14 15:51 ..
-rw-rw-r--. 1 nagios nagios 576 Jan 14 15:51 config.inc.php
drwxrwxr-x. 2 nagios nagios 4096 Jan 14 15:51 contexthelp
drwxrwxr-x. 3 nagios nagios 4096 Jan 14 15:51 docs
drwxrwxr-x. 3 nagios nagios 4096 Jan 14 15:51 images
drwxrwxr-x. 3 nagios nagios 4096 Jan 14 15:51 includes
-rw-rw-r--. 1 nagios nagios 1608 Jan 14 15:51 index.php
drwxrwxr-x. 2 nagios nagios 4096 Jan 14 15:51 js
drwxr-xr-x. 4 root root 4096 Jan 14 16:02 locale
-rw-rw-r--. 1 nagios nagios 5865 Jan 14 15:51 main.php
drwxrwxr-x. 2 nagios nagios 4096 Jan 14 15:51 media
-rw-rw-r--. 1 nagios nagios 26 Jan 14 15:51 robots.txt
-rw-rw-r--. 1 nagios nagios 941 Jan 14 15:51 rss-corefeed.php
-rw-rw-r--. 1 nagios nagios 995 Jan 14 15:51 rss-newsfeed.php
-rw-rw-r--. 1 nagios nagios 5756 Jan 14 15:51 side.php
drwxrwxr-x. 2 nagios nagios 4096 Jan 14 15:51 ssi
drwxrwxr-x. 2 nagios nagios 4096 Jan 14 15:51 stylesheets
[root@localhost ~]#
Locked