Page 5 of 6

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 2:36 pm
by gyr
Which file?

root@nagiosxi conf.d]# pwd
/etc/httpd/conf.d
[root@nagiosxi conf.d]# ls
cacti.conf mrtg.conf nagiosql.conf nagvis.conf php.conf python.conf ssl.conf welcome.conf
cacti.conf.rpmnew nagios.conf nagiosxi.conf nrdp.conf phpmyadmin.conf README ssl.conf.nagiosxibackup
manual.conf nagiosmobile.conf nagiosxi.conf.gene perl.conf proxy_ajp.conf squid.conf webalizer.conf

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 2:40 pm
by tmcdonald
/etc/httpd/conf.d/nagiosxi.conf

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 2:53 pm
by gyr
Ok here is the file now, did I not end the virtual host on the correct line maybe.
I did restart the web server and it restarted ok but no joy.

here is the file now

[root@nagiosxi conf.d]# cat nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# 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"

<VirtualHost *:80>
<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 Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
</Directory>
</VirtualHost>

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 Monitor XI"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
</Directory>


nmap -p 80,443 localhost

Starting Nmap 5.00 ( http://nmap.org ) at 2014-01-08 12:51 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 conf.d]#

root@nagiosxi conf.d]# /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/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'Submit=Login&tfUsername=nagiosxi&tfPassword=n@gweb' -O n
--2014-01-08 12:52:44-- http://localhost/nagiosql/index.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... failed: Connection refused.
--2014-01-08 12:52:44-- http://localhost/nagiosql/index.php
Connecting to localhost|127.0.0.1|:80... failed: Connection refused.

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 3:25 pm
by abrist
Lets double check a few things:

Code: Select all

service iptables status
iptables -L
netstat -alnp | grep ::80
grep "Listen 80" /etc/httpd/conf/httpd.conf

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 3:35 pm
by gyr
[root@nagiosxi conf.d]# service iptables status
Firewall is stopped.
[root@nagiosxi conf.d]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@nagiosxi conf.d]# netstat -alnp | grep ::80
[root@nagiosxi conf.d]# grep "Listen 80" /etc/httpd/conf/httpd.conf
#Listen 80

Ahahha Sheesh I fixed this and now

[root@nagiosxi conf.d]# /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/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosql/index.php --no-check-certificate --post-data 'Submit=Login&tfUser
name=nagiosxi&tfPassword=n@gweb' -O nagiosql.login'Submit=Login&tfUsername=nagiosxi&tfPassword=n@gweb' -O n
--2014-01-08 13:34:54-- http://localhost/nagiosql/index.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost/nagiosql/index.php [following]
--2014-01-08 13:34:54-- https://localhost/nagiosql/index.php
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhost's certificate, issued by `/C=US/O=Idaho National Laboratory/CN=INLIntCA':
Unable to locally verify the issuer's authority.
WARNING: certificate common name `nagiosxi.inl.gov' doesn't match requested host name `localhost'.
HTTP request sent, awaiting response... 200 OK
Length: 5259 (5.1K) [text/html]
Saving to: `n'

100%[===========================================================================================================================================================>] 5,259 --.-K/s in 0s

2014-01-08 13:34:54 (27.1 MB/s) - `n' saved [5259/5259]

--2014-01-08 13:34:54-- http://localhost/nagiosql/index.php
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost/nagiosql/index.php [following]
--2014-01-08 13:34:54-- https://localhost/nagiosql/index.php
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhost's certificate, issued by `/C=US/O=Idaho National Laboratory/CN=INLIntCA':
Unable to locally verify the issuer's authority.
WARNING: certificate common name `nagiosxi.inl.gov' doesn't match requested host name `localhost'.
HTTP request sent, awaiting response... 200 OK
Length: 5259 (5.1K) [text/html]
Saving to: `n'

100%[===========================================================================================================================================================>] 5,259 --.-K/s in 0s

2014-01-08 13:34:54 (59.2 MB/s) - `n' saved [5259/5259]

FINISHED --2014-01-08 13:34:54--
Downloaded: 2 files, 10K in 0s (37.2 MB/s)

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 3:42 pm
by abrist
whew. Check to make sure it is behaving properly. Any other issues related to this one?
EDIT: looks like you may need to also set the fqdn on the server . . . Can you log in now?

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 3:45 pm
by gyr
So I went back and reran the upgrade script. Attached are the results

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 3:49 pm
by abrist
Your db password may be wrong, what is the output of:

Code: Select all

cat /usr/local/nagiosxi/html/config.inc.php | grep -m 2 -A5 "\"nagiosql\" => array"

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 4:04 pm
by gyr
[root@nagiosxi nagiosxi]# cat /usr/local/nagiosxi/html/config.inc.php | grep -m 2 -A5 "\"nagiosql\" => array"
"nagiosql" => array(
"dbtype" => 'mysql',
"dbserver" => 'localhost',
"user" => 'nagiosql',
"pwd" => 'n@gweb',
"db" => 'nagiosql',
--
"nagiosql" => array(
"dir" => "/var/www/html/nagiosql",
"direct_url" => "/nagiosql",
"username" => 'nagiosxi', // don't change this!
"password" => 'n@gweb', // this gets reset when security credentials are reset after installation
),

I cannot log in on the web page but I do get the front screen "Welcome"

What do you want me to do to fqn the server?
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
x.x.x.x nagiosxi.inl.gov nagiosxi

Re: Upgrading Nagios -- blew up

Posted: Wed Jan 08, 2014 4:56 pm
by abrist
What is the output of:

Code: Select all

cat /var/www/html/nagiosql/config/settings.php | grep password