Ajax call problem in Nagvis

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
morabanc
Posts: 199
Joined: Tue Jul 10, 2012 8:14 am

Ajax call problem in Nagvis

Post by morabanc »

Hi guys,

After Nagios XI upgrade we noticed that nagvis gives us this error I attach you below:

- https://ibb.co/b6wBXe

Can you help us ?


Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ajax call problem in Nagvis

Post by scottwilkerson »

Can you post the output of the following after opening the page

Code: Select all

grep nagvis /var/log/httpd/error_log
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
morabanc
Posts: 199
Joined: Tue Jul 10, 2012 8:14 am

Re: Ajax call problem in Nagvis

Post by morabanc »

Hi scott,

Here you are:

grep nagvis /var/log/httpd/error_log

Code: Select all

[Sun Aug 19 04:01:01 2018] [error] [client 192.168.174.248] PHP Warning:  Division by zero in /usr/local/nagvis/share/userfiles/gadgets/std_speedometer.php on line 114, referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 04:01:01 2018] [error] [client 192.168.174.248] PHP Warning:  Division by zero in /usr/local/nagvis/share/userfiles/gadgets/std_speedometer.php on line 115, referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 06:01:20 2018] [error] [client 192.168.174.149] PHP Fatal error:  Cannot redeclare class adLDAPException in /usr/local/nagiosxi/html/includes/components/active_directory/adLDAP/adLDAP.php on line 3031, referer: http://172.16.40.1/nagiosxi/login.php?redirect=%2Fnagvis%2Ffrontend%2Fnagvis-js%2Findex.php%3Fmod%3DMap%26act%3Dview%26show%3DExp_Gravadores
[Sun Aug 19 19:36:28 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:36:28 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:36:38 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:36:38 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:36:47 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:36:48 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:36:48 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:36:57 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:36:58 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:36:58 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:37:07 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:37:08 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:37:08 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:47:12 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:47:17 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:47:18 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:47:18 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:47:22 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:47:27 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:47:28 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:47:28 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:47:37 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Digital_Banking
[Sun Aug 19 19:47:38 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Monitoritzacio
[Sun Aug 19 19:47:38 2018] [error] [client 192.168.174.248] Could not initialize a database connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2), referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:48:18 2018] [error] [client 192.168.174.248] PHP Warning:  Division by zero in /usr/local/nagvis/share/userfiles/gadgets/std_speedometer.php on line 114, referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch
[Sun Aug 19 19:48:18 2018] [error] [client 192.168.174.248] PHP Warning:  Division by zero in /usr/local/nagvis/share/userfiles/gadgets/std_speedometer.php on line 115, referer: https://172.16.40.1/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Exp_Control_Batch

Thanks :)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ajax call problem in Nagvis

Post by scottwilkerson »

You are getting a lot of database connection errors, is mysqld running?

Code: Select all

service mysqld status
or

Code: Select all

systemctl status mariadb
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
morabanc
Posts: 199
Joined: Tue Jul 10, 2012 8:14 am

Re: Ajax call problem in Nagvis

Post by morabanc »

Yes it's running:

Code: Select all

service mysqld status
 mysqld (pid  17751) is running...
And we can access to it:

Code: Select all

[root@nagiosxi erju01d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5391
Server version: 5.1.61-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| my_wiki            |
| mysql              |
| nagios             |
| nagiosql           |
| test               |
+--------------------+
8 rows in set (0.00 sec)

mysql>
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ajax call problem in Nagvis

Post by scottwilkerson »

Can you verify that under Options -> Manage Backend -. nagiosxi is specified

If so, click on edit backend selecting nagiosxi and verify you have the correct user/password for your nagios database
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
morabanc
Posts: 199
Joined: Tue Jul 10, 2012 8:14 am

Re: Ajax call problem in Nagvis

Post by morabanc »

Hi scott,

Where is this menu in nagiosxi gui ?

By the way, today at 7:50 nagios was well but 10-15 min after all services/hosts was delete and only remained 83 hosts (we have 683). Why this happened ?

Thx !
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ajax call problem in Nagvis

Post by scottwilkerson »

morabanc wrote:Where is this menu in nagiosxi gui ?
Under Nagvis
morabanc wrote: By the way, today at 7:50 nagios was well but 10-15 min after all services/hosts was delete and only remained 83 hosts (we have 683). Why this happened ?
I don't understand the question, what happened?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
morabanc
Posts: 199
Joined: Tue Jul 10, 2012 8:14 am

Re: Ajax call problem in Nagvis

Post by morabanc »

In reference to manage backend it seems to be ok.
I used the user/password configured in the Backend and works properly.

Code: Select all

[root@nagiosxi]# mysql -u ndoutils -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 30939
Server version: 5.1.61-log Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| nagios             |
| test               |
+--------------------+
3 rows in set (0.01 sec)

mysql>
The other question it's that we actually have 683 hosts and 3850 services monitoring.
This morning for any strange reason all services and hosts desappeared and only 83 hosts remained.
After that, I rebooted the Nagios machine and then it worked correctly with all the hosts and services that we had before.
It's just to give you notice.


Thanks !
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Ajax call problem in Nagvis

Post by scottwilkerson »

morabanc wrote:After that, I rebooted the Nagios machine and then it worked correctly with all the hosts and services that we had before.
It's just to give you notice.
Thanks for the heads up on this, I would verify you aren't running low on disk space , that's the only thing I can think could cause this

Code: Select all

df -h
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked