web page wont load

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
nottheadmin
Posts: 53
Joined: Thu Dec 19, 2013 9:51 am
Location: Amsterdam, NL

web page wont load

Post by nottheadmin »

An IT guy just added a virtual NIC to the vsphere appliance. This created havoc on the system, it got rebooted, the web page does not load.

When browsing to the url, I do get the "access nagios" front page. When i click on Access nagios to take me to http://10.99.34.100/nagiosxi/, I just get a blank page.

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Mar 13 00:26:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Code: Select all

[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:56:A9:4D:72
          inet addr:10.99.34.100  Bcast:10.99.34.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fea9:4d72/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:812 errors:0 dropped:0 overruns:0 frame:0
          TX packets:516 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:573265 (559.8 KiB)  TX bytes:103876 (101.4 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:162 errors:0 dropped:0 overruns:0 frame:0
          TX packets:162 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:80519 (78.6 KiB)  TX bytes:80519 (78.6 KiB)

Code: Select all

[root@localhost ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.99.34.0      *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
default         10.99.34.1      0.0.0.0         UG    0      0        0 eth0
I had literally just got it the way I wanted it too :(

Does anyone know why adding a 2nd NIC would do this?

More importantly, how can I get the web interface to load again.

Thanks :D
nottheadmin
Posts: 53
Joined: Thu Dec 19, 2013 9:51 am
Location: Amsterdam, NL

Re: web page wont load

Post by nottheadmin »

Looks like a mysql problem?

from /var/log/httpd/error_log

Code: Select all

[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-mysql.inc.php on line 383
[Mon Feb 17 16:12:13 2014] [error] [client 62.179.96.1] File does not exist: /var/www/html/favicon.ico
nottheadmin
Posts: 53
Joined: Thu Dec 19, 2013 9:51 am
Location: Amsterdam, NL

Re: web page wont load

Post by nottheadmin »

Mysql was not running for some reason, would not start either.

service mysqld status

I had to rm -rf /var/lib/mysql/mysql.sock

then i was able to start mysql with service mysqld start

Hope that helps someone else one day.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: web page wont load

Post by tmcdonald »

Hey, sorry we missed you. Had a later start today due to a 7" snowfall here :(

Usually when you see the blank page it is due to MySQL, and the reason it might not start is if your VM had an unclean shutdown. The following document explains it pretty well:

http://assets.nagios.com/downloads/nagi ... tabase.pdf
Former Nagios employee
nottheadmin
Posts: 53
Joined: Thu Dec 19, 2013 9:51 am
Location: Amsterdam, NL

Re: web page wont load

Post by nottheadmin »

Yeah it's ok, better in the long run that i fixed it myself.

What is the safe way to reboot a nagios server then?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: web page wont load

Post by tmcdonald »

"shutdown -r now" to restart or "shutdown -h now" to turn off.
Former Nagios employee
nottheadmin
Posts: 53
Joined: Thu Dec 19, 2013 9:51 am
Location: Amsterdam, NL

Re: web page wont load

Post by nottheadmin »

that will close mysql down gracefully?

I just used 'reboot' before
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: web page wont load

Post by slansing »

Correct, it will, straight shutting down, or powering down a VM though the interface you use (be it vmware player, workstation, vSphere etc..) Is essentially like pulling the AC adapter out of your workstation while it's still running.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: web page wont load

Post by tmcdonald »

Reboot is simpler. Issuing a shutdown command allows you to specify a time, it warns users that the system is going down, and it prevents logins within 5 minutes of the reboot (if the reboot is more than 5 minutes out of course). Reboot also - from what I understand - does not stop services via init scripts before shutting the system down.
Former Nagios employee
nottheadmin
Posts: 53
Joined: Thu Dec 19, 2013 9:51 am
Location: Amsterdam, NL

Re: web page wont load

Post by nottheadmin »

OK understood, no more 'reboot'
Locked