Page 1 of 3

Web Interface to Nagios Core - connection has timed out

Posted: Wed Jun 01, 2016 7:54 pm
by hbackus
I can not open a web browser to the Nagios install I did on Centos.
2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 GNU/Linux

netstat -tnulp shows port 80 as available
tcp 0 0 :::80 :::* LISTEN 7029/httpd

I edited the iptables in /etc/sysconfig/iptables to allow Nagios ports
#HTTP/HTTPS
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
#NRPE
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT
#NSCA
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5667 -j ACCEPT
COMMIT

check_http seems to indicate that httpd is running
[root@nagiosxi ~]# /usr/local/nagios/libexec/check_http -H 127.0.0.1
HTTP OK: HTTP/1.1 200 OK - 265 bytes in 0.000 second response time |time=0.000455s;;;0.000000 size=265B;;;0

ps-ef seems to indicate that httpd is running
ps -ef | grep -i "http"
apache 7029 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7030 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7031 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7032 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7033 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7034 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7035 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
apache 7036 32244 0 03:12 ? 00:00:00 /usr/sbin/httpd
root 15362 15137 0 14:57 pts/0 00:00:00 grep -i http
root 32244 1 0 May31 ? 00:00:00 /usr/sbin/httpd

from a remote workstation telnet "ip_address_of_nagios 22" on port 22 indicates that the port is open
but telnet "ip_address_of_nagios 80" on port 80 gets no response

Any help on getting the web interface to Nagios Core working would be appreciated

I have the entire CLI install file if needed.

Re: Web Interface to Nagios Core - connection has timed out

Posted: Wed Jun 01, 2016 8:28 pm
by Box293
Can you show us the guide/steps you used to perform the install.

Re: Web Interface to Nagios Core - connection has timed out

Posted: Tue Jun 07, 2016 6:11 pm
by hbackus
Here it is, let me know if you need additional information.......thanks for your time.


./configure --with-command-group=nagioscmd

*** Configuration summary for nagios 4.1.1 08-19-2015 ***:

General Options:
-------------------------
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagioscmd
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Install ${includedir}: /usr/local/nagios/include/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/rc.d/init.d
Apache conf.d directory: /etc/httpd/conf.d
Mail program: /bin/mail
Host OS: linux-gnu
IOBroker Method: epoll

Web Interface Options:
------------------------
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /bin/traceroute

[root@nagiosxi nagios-4.1.1]# make all

*** Compile finished ***

[root@nagiosxi nagios-4.1.1]# make install

*** Exfoliation theme installed ***

make install-basic

*** Main program, CGIs and HTML files installed ***

[root@nagiosxi nagios-4.1.1]# make install-init

*** Init script installed ***

[root@nagiosxi nagios-4.1.1]# make install-config

*** Config files installed ***

[root@nagiosxi nagios-4.1.1]# make install-configcommandmode

*** External command directory configured ***

[root@nagiosxi nagios-4.1.1]# make-install-webconfinstall-webconf install-webconf

*** Nagios/Apache conf file installed ***

[root@nagiosxi tmp]# cd nagios-plugins-2.1.1

[root@nagiosxi nagios-plugins-2.1.1]# ./configure

make all-recursive

[root@nagiosxi nagios-plugins-2.1.1]# make install

[root@nagiosxi nagios-plugins-2.1.1]# make install

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

[root@nagiosxi ~]#
[root@nagiosxi ~]# /etc/init.d/nagios restart
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
[root@nagiosxi ~]#

[root@nagiosxi tmp]# cd nrpe-2.15
[root@nagiosxi nrpe-2.15]# ./configure --enable-command-args

*** Generating DH Parameters for SSL/TLS ***
Generating DH parameters, 512 bit long safe prime, generator 2
This is going to take a long time

*** Configuration summary for nrpe 2.15 09-06-2013 ***:

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios

[root@nagiosxi nrpe-2.15]# make all

*** Compile finished ***

[root@nagiosxi nrpe-2.15]# make install-plugin

[root@nagiosxi nrpe-2.15]# make install-daemon

[root@nagiosxi nrpe-2.15]# make install-xinetd

[root@nagiosxi nrpe-2.15]# make install-daemon-config

[root@nagiosxi nrpe-2.15]# /etc/init.d/xinetd restart

[root@nagiosxi nrpe-2.15]# chkconfig --add xinetd

[root@nagiosxi nrpe-2.15]# chkconfig --alevel 35 xinetd on

[root@nagiosxi tmp]# cd nrdp
[root@nagiosxi nrdp]# cp -r * /usr/local/nrdp

[root@nagiosxi nrdp]# chown -R nagios.nagios /usr/local/nrdp

[root@nagiosxi nrdp]# cp nrdp.conf /etc/httpd/conf.d

[root@nagiosxi nrdp]#
[root@nagiosxi nrdp]# chkconfig --add nagios
[root@nagiosxi nrdp]# chkconfig --level 35 nagios 0non
[root@nagiosxi nrdp]# chkconfig --add httpd
[root@nagiosxi nrdp]# chkconfig --level 35 httpd on


[root@nagiosxi nrdp]# /etc/init.d/httpd start
Starting httpd:
[root@nagiosxi nrdp]#
[root@nagiosxi nrdp]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin
[root@nagiosxi nrdp]#
[root@nagiosxi nrdp]#
[root@nagiosxi nrdp]# chkconfig --add nagios
[root@nagiosxi nrdp]# chkconfig --level 35 nagios 0non
[root@nagiosxi nrdp]# chkconfig --add httpd
[root@nagiosxi nrdp]# chkconfig --level 35 httpd on
[root@nagiosxi nrdp]#

[root@nagiosxi nrdp]# cat /etc/sysconfig/iptables
# 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 FORWARD -j REJECT --reject-with icmp-host-prohibited
#HTTP/HTTPS
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
#NRPE
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT
#NSCA
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5667 -j ACCEPT
COMMIT
[root@nagiosxi nrdp]# /etc/init.d/iptables restaert

Re: Web Interface to Nagios Core - connection has timed out

Posted: Tue Jun 07, 2016 7:31 pm
by Box293
Is SELinux Enabled?

If it is, execute these commands:

Code: Select all

sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
setenforce 0
Also, I would like to see your firewall rules. I know you provided a CAT of them earlier, but I would like to see them from the firewall application:

Code: Select all

iptables --list

firewall-cmd --list-all

Re: Web Interface to Nagios Core - connection has timed out

Posted: Wed Jun 08, 2016 5:23 am
by eloyd
My first step in situations like this is simply to turn off firewalls real quick, just to see if that's the problem. If it works, you know it's the firewall. If not, you have more troubleshooting to do.

Re: Web Interface to Nagios Core - connection has timed out

Posted: Wed Jun 08, 2016 1:25 pm
by tgriep
Another thing you could do is to look at the Apache server log files in this folder for any errors.

Code: Select all

/var/log/httpd/

Re: Web Interface to Nagios Core - connection has timed out

Posted: Thu Jun 09, 2016 9:32 pm
by hbackus
Too Basu:

"SELinux is disabled"

[root@nagiosxi ~]# sed -i 's/SELinuxINUX=enforceing/SELINUX=permissive/g' /etc/selinux/config
[root@nagiosxi ~]# setenforce 0
setenforce: SELinux is disabled

"IPTables list"

[root@nagiosxi ~]# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:nrpe
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:5667

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@nagiosxi ~]#

http://<my_nagios_core_ip_address>/nagios "still gives me the page can not be displayed"

thanks for your response.

Re: Web Interface to Nagios Core - connection has timed out

Posted: Thu Jun 09, 2016 9:41 pm
by hbackus
tgriep:

I don't see anything in the log that indicates there is problem

127.0.0.1 - - [09/Jun/2016:15:53:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:15:58:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:03:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:08:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:13:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:18:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:23:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:28:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:33:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:38:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"
127.0.0.1 - - [09/Jun/2016:16:43:11 -0500] "GET / HTTP/1.0" 200 - "-" "check_http/v2.1.1 (nagios-plugins 2.1.1)"

thanks for the guidance.....

Re: Web Interface to Nagios Core - connection has timed out

Posted: Thu Jun 09, 2016 9:56 pm
by eloyd
More importantly, I don't see anything in the log that shows you are actually hitting your Web server. Something is blocking or you are using the wrong address or else you would have seen browser based hits in your access log.

Re: Web Interface to Nagios Core - connection has timed out

Posted: Fri Jun 10, 2016 10:06 am
by tgriep
Could you post this file from your Nagios server?

Code: Select all

/etc/httpd/conf.d/nagios.conf