NagVis JavaScript error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Superdupernagios
Posts: 5
Joined: Thu May 03, 2018 3:22 am

NagVis JavaScript error

Post by Superdupernagios »

Lately we have revceived this error when opening NagVis. Any tip?
Javascript error occured: Uncaught ReferenceError: oUserProperties is not defined.
<ourservername>/nagvis/frontend/nagvis-js/js/NagVisCompressed?v=1.9.8 (4892)
Nagios XI version: 5.5.4
XI installed from: source
CentOS release: 6.9 (Final)
Gnome is not installed
Chrome 60
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NagVis JavaScript error

Post by cdienger »

Are you seeing this with all nagios users? Have you tried with the nagiosadmin user? Which browsers are you testing with?

I assume you're getting this error when you click the NagVis link under Home > Maps. Is this a safe assumption or are you accessing the page another way? Does pointing your browser directly to Nagvis(https://nagiosxi_ip/nagvis/) produce the same error?

Please provide the info screen displayed by pointing the browser to https://nagiosxi_ip/nagvis/frontend/nagvis-js/index.php?mod=Info
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NagVis JavaScript error

Post by tgriep »

Lets see if there are any errors in the Apache web server log files when you try to open the Nagvis interface.

Run this command as root on the Nagios server

Code: Select all

tail -f /var/log/httpd/*_log
Login to the XI GUI and go to the Nagvis menu and post the output from the tail command here so we can view the errors.

One question, could you access the Nagvis menu at all or is this error always happen since the install was first done?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Superdupernagios
Posts: 5
Joined: Thu May 03, 2018 3:22 am

Re: NagVis JavaScript error

Post by Superdupernagios »

Yes, all our users have this problem. We've tried with Firefox 62, Chrome 69 and Internet Explorer 11. Same issue on all. We get this error by both going directly trought the URL to Nagvis, and via Maps > NagVis. We get the overview page with all the Map Indexes, but once we click any of them, inculding the "demos", the Javascript error pops up.

We had access to NagVis before, so I'm not sure when we this started happening. It was either after we upgraded to version 5.5.4, or when we had an issue when the VMWare server went down. But we ran the repair_databases.sh to ensure it was OK.
Version Information
NagVis Version 1.9.8
PHP Version 5.3.3
MySQL Version mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
OS Linux <nagiosxi_ip> 2.6.32-696.30.1.el6.x86_64 #1 SMP Tue May 22 03:28:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Webserver Information
SERVER_SOFTWARE Apache/2.2.15 (CentOS)
SCRIPT_FILENAME /usr/local/nagvis/share/frontend/nagvis-js/index.php
SCRIPT_NAME /nagvis/frontend/nagvis-js/index.php
REQUEST_TIME 1538026549 (gmdate(): Thu, 27 Sep 2018 05:35:49 +0000)

PHP Information
error_reporting 32767
safe_mode no
max_execution_time 30 seconds
memory_limit 128M
loaded modules Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, Reflection, session, standard, shmop, SimpleXML, sockets, exif, tokenizer, xml, apache2handler, curl, dom, fileinfo, gd, json, ldap, mbstring, mcrypt, mssql, mysql, mysqli, PDO, pdo_dblib, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, snmp, SourceGuardian, sqlite3, ssh2, wddx, xmlreader, xmlwriter, xsl, zip
json_encode Yes
json_decode Yes

Client Information
USER_AGENT Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36

Logon Information
Logon Module LogonSession
Auth Module CoreAuthModSQLite
Authorization Module CoreAuthorisationModSQLite
Logon Var REMOTE_USER
REMOTE_USER
Logon Create User? 1
Logon Create User Role? Guests

Current User Information
User Logged In <my_user>
User Auth Module
User Logon Module
User Trusted Auth Yes
User Roles [{"roleId":"1","name":"Administrators"}]
User Permissions {"*":{"*":{"*":[]}}}
Regarding the error on web server log files request, I have to go through the output and remove certain data first.

Thanks for the help so far, I hope the above might give you some info.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NagVis JavaScript error

Post by cdienger »

What do the permissions look like on the /usr/local/nagvis directory and files ? It looks like oUserProperties is declared in /usr/local/nagvis/share/userfiles/templates/default.map.htmland /usr/local/nagvis/share/userfiles/templates/default.map.html. Permissions on these file should look like:

-rw-r--r-- 1 apache nagios 618 Jun 8 12:59 default.map.html
-rw-r--r-- 1 apache nagios 610 Jun 8 12:59 default.overview.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagVis JavaScript error

Post by scottwilkerson »

Do you also get this if you are logged in as nagiosadmin?

Also, if you click User Menu at the top and select users, are they Administrators?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Superdupernagios
Posts: 5
Joined: Thu May 03, 2018 3:22 am

Re: NagVis JavaScript error

Post by Superdupernagios »

cdienger wrote:What do the permissions look like on the /usr/local/nagvis directory and files ? It looks like oUserProperties is declared in /usr/local/nagvis/share/userfiles/templates/default.map.htmland /usr/local/nagvis/share/userfiles/templates/default.map.html. Permissions on these file should look like:

-rw-r--r-- 1 apache nagios 618 Jun 8 12:59 default.map.html
-rw-r--r-- 1 apache nagios 610 Jun 8 12:59 default.overview.html
All the directories have permission drwxr-xr-x, while the files you mentioned (an all other files), have permission -rw-r--r--.
scottwilkerson wrote:Do you also get this if you are logged in as nagiosadmin?

Also, if you click User Menu at the top and select users, are they Administrators?
Yes, it happens on the default nagiosadmin user as well. Some users was not marked as Administrators (my user was), but changing that did nothing. I clicked the Manage Roles menu, and Administrators had no permissions. I checked all the boxes (but maybe the asteriks would be enough?), but no difference so far. Does any processes need to be restarted for this to take effect?

We also get a split second of a second JavaScript error when clicking on the maps. It's Uncaught ReferenceError: contextMouseDown is not defined http://<nagios_ip>/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=<our_map> (255)

Not sure if that has anything to do with it, but I figured I'd let you know anyways.

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

Re: NagVis JavaScript error

Post by scottwilkerson »

This is quite bizarre, if you open Nagvis and get the error, then run the following from the CLI on the server do you see errors?

Code: Select all

grep nagvis /var/log/httpd/error_log
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Superdupernagios
Posts: 5
Joined: Thu May 03, 2018 3:22 am

Re: NagVis JavaScript error

Post by Superdupernagios »

Nothing more than that favicon.ico doesn't exist.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagVis JavaScript error

Post by scottwilkerson »

Would it be possible for you to tar up the nagvis directory on your server and send it to us

Code: Select all

cd /usr/local
tar czfp nagvis.tar.gz nagvis
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked