Page 1 of 2

web page wont load

Posted: Mon Feb 17, 2014 10:50 am
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

Re: web page wont load

Posted: Mon Feb 17, 2014 11:20 am
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

Re: web page wont load

Posted: Mon Feb 17, 2014 11:25 am
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.

Re: web page wont load

Posted: Mon Feb 17, 2014 11:29 am
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

Re: web page wont load

Posted: Tue Feb 18, 2014 4:07 am
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?

Re: web page wont load

Posted: Tue Feb 18, 2014 10:30 am
by tmcdonald
"shutdown -r now" to restart or "shutdown -h now" to turn off.

Re: web page wont load

Posted: Tue Feb 18, 2014 10:42 am
by nottheadmin
that will close mysql down gracefully?

I just used 'reboot' before

Re: web page wont load

Posted: Tue Feb 18, 2014 1:46 pm
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.

Re: web page wont load

Posted: Tue Feb 18, 2014 1:53 pm
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.

Re: web page wont load

Posted: Mon Feb 24, 2014 5:41 am
by nottheadmin
OK understood, no more 'reboot'