Page 1 of 1

Nagios Core 4.4.5 - Map.php not displaying

Posted: Thu Nov 28, 2019 9:45 am
by playzoneuk
Good afternoon all,

I've installed the latest version of the Nagios Core Version 4.4.5, everything seems to work ok apart from the Map link. When clicked, it shows Network Map for All Hosts in the top left hand corner with a quarter of the loading wheel over the top and nothing happens.

My setup is as follows:
Operating System: Windows 10
Browser: Internet Explorer 11

Nagios Server Details:
O/S: Ubuntu 18.04 LTS
Nagios Core 4.4.5

When press F12 to view the Console / Debug within IE11, I’m presented with the following error:

TypeError: Object doesn't support property or method 'findIndex'
at Anonymous function (http://server/nagios/js/map-directive.js:1109:7)
at updateHostTree (http://server/nagios/js/map-directive.js:1108:6)
at processHostList (http://server/nagios/js/map-directive.js:1256:6)
at Anonymous function (http://server/nagios/js/map-directive.js:1330:8)
at Anonymous function (http://server/nagios/angularjs/angular- ... .js:81:132)
at Anonymous function (http://server/nagios/angularjs/angular- ... js:112:333)
at l.prototype.$eval (http://server/nagios/angularjs/angular- ... js:126:182)
at l.prototype.$digest (http://server/nagios/angularjs/angular- ... js:123:278)
at l.prototype.$apply (http://server/nagios/angularjs/angular- ... js:126:469)
at l (http://server/nagios/angularjs/angular- ... .js:81:420)


Any help would be greatly appreciated.

Thanks
PlayZoneUK

Re: Nagios Core 4.4.5 - Map.php not displaying

Posted: Mon Dec 02, 2019 9:52 am
by scottwilkerson
I did some investigating and there is an imcompatibility with IE 11, if you make the following change
in /usr/local/nagios/share/js/map-directive.js it should resolve the issue in IE

change this ~ line 1109

Code: Select all

						var childIndex = node.children.findIndex(function(s) {
							return s.hostInfo.name === e;
						});
with this

Code: Select all

						var childIndex = -1;
						for (let i = 0; i < node.children.length; i++) {
							if (node.children[i].hostInfo.name === e) {
								childIndex = i;
								break;
							}
						}
I have made a pull request to get this fix added in future versions
https://github.com/NagiosEnterprises/na ... e/pull/714

Re: Nagios Core 4.4.5 - Map.php not displaying

Posted: Mon Dec 16, 2019 1:04 pm
by playzoneuk
Hi scottwilkerson, sorry for the late reply.

The suggested fixed worked like a charm.

Thanks for the assistance

Re: Nagios Core 4.4.5 - Map.php not displaying

Posted: Mon Dec 16, 2019 1:06 pm
by scottwilkerson
playzoneuk wrote:Hi scottwilkerson, sorry for the late reply.

The suggested fixed worked like a charm.

Thanks for the assistance
Great!

Locking thread