Page 1 of 6

Web interface time out

Posted: Wed Jan 15, 2014 10:30 am
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

Re: Web interface time out

Posted: Wed Jan 15, 2014 11:40 am
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

Re: Web interface time out

Posted: Wed Jan 15, 2014 12:05 pm
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/

Re: Web interface time out

Posted: Wed Jan 15, 2014 12:07 pm
by rlevick
I had check this before:
[root@localhost ~]# service nagios status
nagios (pid 1643 1640 1639 1638 1637 1633) is running...

Re: Web interface time out

Posted: Wed Jan 15, 2014 12:27 pm
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

Re: Web interface time out

Posted: Wed Jan 15, 2014 3:17 pm
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.

Re: Web interface time out

Posted: Wed Jan 15, 2014 4:22 pm
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.

Re: Web interface time out

Posted: Wed Jan 15, 2014 4:41 pm
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>

Re: Web interface time out

Posted: Wed Jan 15, 2014 5:07 pm
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

Re: Web interface time out

Posted: Wed Jan 15, 2014 5:17 pm
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 ~]#