Set Default Map NagiosXI
Set Default Map NagiosXI
I would like to add a map layout to "Views" but I need it to be different than the default circular balloon layout. I have searched the forums and saw where someone said to edit the:
"You can open the "/usr/local/nagiosxi/html/includes/utils-links.inc.php" file in a text editor and change line 145 from this:
CODE: SELECT ALL
function get_statusmap_link($layout = 6, $dest = "auto")
to this:
CODE: SELECT ALL
function get_statusmap_link($layout = 5, $dest = "auto")"
Which I have done (though now its like 150 something) and the default layout says the same. Is it possible to lock the map to one layout the way I like it, and attach that layout to views?
Thank You!
"You can open the "/usr/local/nagiosxi/html/includes/utils-links.inc.php" file in a text editor and change line 145 from this:
CODE: SELECT ALL
function get_statusmap_link($layout = 6, $dest = "auto")
to this:
CODE: SELECT ALL
function get_statusmap_link($layout = 5, $dest = "auto")"
Which I have done (though now its like 150 something) and the default layout says the same. Is it possible to lock the map to one layout the way I like it, and attach that layout to views?
Thank You!
Re: Set Default Map NagiosXI
See here:
https://support.nagios.com/kb/article/n ... n-726.html
Use the link, add layout onto it via the guide, add it like so:
You can test it in the browser to see the changes.
https://support.nagios.com/kb/article/n ... n-726.html
Use the link, add layout onto it via the guide, add it like so:
Code: Select all
http://YOURXISERVER/nagiosxi/includes/components/statusmap/index.php?layout=7
Re: Set Default Map NagiosXI
I have done this, but the layout stays the default circular balloon.
https://MYSERVER/nagiosxi/includes/comp ... CH-CHARTER
I have tried others besides 7 no luck.
https://MYSERVER/nagiosxi/includes/comp ... CH-CHARTER
I have tried others besides 7 no luck.
Re: Set Default Map NagiosXI
What XI version are you using? I just tested in mine with 2 and 7 and they show differently, I think you are right though, they look the same but bigger. Let me see what I can find.
Re: Set Default Map NagiosXI
Your installation of Nagios XI (5.6.9)ssax wrote:What XI version are you using? I just tested in mine with 2 and 7 and they show differently, I think you are right though, they look the same but bigger. Let me see what I can find.
Re: Set Default Map NagiosXI
The original link you modified only deals with the legacy status map so that won't work. Looking at the other code now.
Re: Set Default Map NagiosXI
As a temporary workaround you can do this and it seems to work:
[/s]
You'll need to replace that file after every upgrade until we find a way to do it through the URL.
Code: Select all
/usr/local/nagiosxi/html/includes/components/statusmap/map.php
Code: Select all
<div id="map-container" ng-hide="formDisplayed"
nagios-map
cgiurl="{{params.cgiurl}}"
layout="7"
You'll need to replace that file after every upgrade until we find a way to do it through the URL.
Re: Set Default Map NagiosXI
This worked for setting the map style, in that same spot I changed root="What I want" and that didn't work.ssax wrote:As a temporary workaround you can do this and it seems to work:
Code: Select all
/usr/local/nagiosxi/html/includes/components/statusmap/map.php
You'll need to replace that file after every upgrade until we find a way to do it through the URL.Code: Select all
<div id="map-container" ng-hide="formDisplayed" nagios-map cgiurl="{{params.cgiurl}}" layout="7"
Any Ideas?
Re: Set Default Map NagiosXI
Ok, please revert that change.
I found out that if you go here and use it, it works:
You could use that and the Dashboards > Available Dashlets > Custom URL Dashlet but you'd either need to hardcode a username/pass in there or enter in your XI creds once it asks.
But for whatever reason XI isn't passing it through properly or it's being overridden somewhere, my guess is by /usr/local/nagios/share/map.php, I'm not sure if this is a bug or intended at this point.
I found out that if you go here and use it, it works:
Code: Select all
http://YOURXISERVER/nagios/map.php?host=all&layout=7
But for whatever reason XI isn't passing it through properly or it's being overridden somewhere, my guess is by /usr/local/nagios/share/map.php, I'm not sure if this is a bug or intended at this point.
Re: Set Default Map NagiosXI
Ok, I got it, please edit this file:
Change this (around line 102) from:
To:
You can also set the default root there:
Change this (around line 110) from:
To:
That should do it, you'll need to replace it after every upgrade until the developers implement a fix to make the main ones pass through properly.
Code: Select all
/usr/local/nagiosxi/html/includes/components/statusmap/js/map.js
Code: Select all
layout: $scope.search.layout ? parseInt($scope.search.layout) :
6,
Code: Select all
layout: $scope.search.layout ? parseInt($scope.search.layout) :
7,
Change this (around line 110) from:
Code: Select all
root: $scope.search.root ? $scope.search.root :
nagiosProcessName,
Code: Select all
root: $scope.search.root ? $scope.search.root :
"YOURROOTNODE",