Upgrading Nagios -- blew up

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gyr
Posts: 29
Joined: Mon Nov 25, 2013 3:55 pm

Re: Upgrading Nagios -- blew up

Post by gyr »

[root@nagiosxi ~]# /usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosql/index.php --no-check-certificate --post-data 'Submit=Login&tfUsername=nagiosxi&tfPassword=n@gweb' -O nagiosql.login
--2014-01-08 10:31:29-- http://localhost/nagiosql/index.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... failed: Connection refused.



[root@nagiosxi ~]# !nmap
nmap -p 80,443 localhost

Starting Nmap 5.00 ( http://nmap.org ) at 2014-01-08 10:31 MST
Interesting ports on localhost.localdomain (127.0.0.1):
PORT STATE SERVICE
80/tcp closed http
443/tcp open https

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
[root@nagiosxi ~]#

No this is sort of where we started the 403 error was reporting through the proxy before, but I have eliminated the proxy.
It apears that port 80 is closed, and the firewall is not on

[root@nagiosxi ~]# service iptables status
Firewall is stopped.


[root@nagiosxi ~]# ps -ef | grep httpd
root 1363 29337 0 10:34 pts/1 00:00:00 grep httpd
root 3414 1 0 Jan07 ? 00:00:00 /usr/sbin/httpd
apache 15457 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15458 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15459 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15460 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15461 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15462 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15463 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
apache 15464 3414 0 04:02 ? 00:00:00 /usr/sbin/httpd
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrading Nagios -- blew up

Post by abrist »

You may want to stop httpd, check for hung or multiple httpd processes and then restart:

Code: Select all

service httpd stop
ps -aef | grep httpd
killall httpd
service httpd start
Additionally, you may want to check your apache vhost file for XI, as it may only have 443/ssl enabled.
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.
gyr
Posts: 29
Joined: Mon Nov 25, 2013 3:55 pm

Re: Upgrading Nagios -- blew up

Post by gyr »

[root@nagiosxi system-config-httpd]# service httpd stop
Stopping httpd: [ OK ]
[root@nagiosxi system-config-httpd]# ps -aef | grep httpd
root 3519 29337 0 10:44 pts/1 00:00:00 grep httpd
[root@nagiosxi system-config-httpd]# killall httpd
httpd: no process killed
[root@nagiosxi system-config-httpd]# service httpd start
Starting httpd: [ OK ]
[root@nagiosxi system-config-httpd]#
[root@nagiosxi system-config-httpd]# /usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosql/index.php --no-check-certificate --post-data 'Submit=Login&tfUsername=nagiosxi&tfPassword=n@gweb' -O nagiosql.login
--2014-01-08 10:45:10-- http://localhost/nagiosql/index.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... failed: Connection refused.
[root@nagiosxi system-config-httpd]#
[root@nagiosxi system-config-httpd]# !nmap
nmap -p 80,443 localhost

Starting Nmap 5.00 ( http://nmap.org ) at 2014-01-08 10:45 MST
Interesting ports on localhost.localdomain (127.0.0.1):
PORT STATE SERVICE
80/tcp closed http
443/tcp open https

Nmap done: 1 IP address (1 host up) scanned in 0.08 seconds
[root@nagiosxi system-config-httpd]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrading Nagios -- blew up

Post by abrist »

Can you post the contents of the vhost file:

Code: Select all

/etc/httpd/conf.d/nagiosxi
And the following grep:

Code: Select all

cat /etc/httpd/con*/* | grep -E "Rewrite.*https"
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.
gyr
Posts: 29
Joined: Mon Nov 25, 2013 3:55 pm

Re: Upgrading Nagios -- blew up

Post by gyr »

[root@nagiosxi conf]# cat /etc/httpd/con*/* | grep -E "Rewrite.*https"
[root@nagiosxi conf]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrading Nagios -- blew up

Post by abrist »

Can you post the contents of the file:

Code: Select all

cat /etc/httpd/conf.d/nagiosxi
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.
gyr
Posts: 29
Joined: Mon Nov 25, 2013 3:55 pm

Re: Upgrading Nagios -- blew up

Post by gyr »

[root@nagiosxi conf]# cat /etc/httpd/conf.d/nagiosxi
cat: /etc/httpd/conf.d/nagiosxi: No such file or directory
[root@nagiosxi conf]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrading Nagios -- blew up

Post by abrist »

Apologies, that last command was truncated. Try:

Code: Select all

cat /etc/httpd/conf.d/nagiosxi.conf
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.
gyr
Posts: 29
Joined: Mon Nov 25, 2013 3:55 pm

Re: Upgrading Nagios -- blew up

Post by gyr »

No worries, here you go, I appreciate all the help

[root@nagiosxi ~]# cat /etc/httpd/conf.d/nagiosxi.conf
<Directory "/usr/local/nagiosxi/html">
# 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 XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Upgrading Nagios -- blew up

Post by abrist »

You could try declaring port 80 in the vhost file /etc/httpd/conf.d/nagiosxi:

Code: Select all

<VirtualHost *:80>
<Directory "/usr/local/nagiosxi/html">
# 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 XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory>
</VirtualHost>
Alias /nagiosxi "/usr/local/nagiosxi/html"
This is strange though, port 80 should be open if httpd is running and iptables is stopped. . .
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.
Locked