High Contrast Status Map option

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
discarn8
Posts: 11
Joined: Mon Jul 24, 2017 11:47 pm

High Contrast Status Map option

Post by discarn8 »

Forgive if this is a 'dead horse' or 'already covered' topic, but after searching the forum, google, etc., I was unable to find the answer.

Is there a way (supported or unsupported) to modify or add a theme, plugin, etc. to create a high contrast status map versus the white background stock version?

It would be Ideal to have a completely black background for the map. Is this something that one can achieve by editing a css file? cgi file?

If this is not a current option, may I officially place my vote for this as a future feature request?

Thank you in advance for any help or guidance.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: High Contrast Status Map option

Post by lmiltchev »

You can try modifying the "/usr/local/nagios/share/map.php" file (the "map-container" section).

Example:
<div id="map-container" ng-hide="formDisplayed"
nagios-map
cgiurl="{{params.cgiurl}}"
layout="{{params.layout}}"
dimensions="{{params.dimensions}}"
ulx="{{params.ulx}}"
uly="{{params.uly}}"
lrx="{{params.lrx}}"
lry="{{params.lry}}"
root="params.root"
maxzoom="params.maxzoom"
nolinks="{{params.nolinks}}"
notext="{{params.notext}}"
nopopups="{{params.nopopups}}"
noresize="{{params.noresize}}"
noicons="{{params.noicons}}"
iconurl="{{params.iconurl}}"
reload="{{reload}}"
update-interval="10"
last-update="lastUpdate"
map-width="svgWidth"
map-height="svgHeight"
style="background:black"
build="canBuildMap()">
</div>
Be sure to check out our Knowledgebase for helpful articles and solutions!
discarn8
Posts: 11
Joined: Mon Jul 24, 2017 11:47 pm

Re: High Contrast Status Map option

Post by discarn8 »

Thank you very much for the reply and tip.

I *believe* that I indeed tried to modify the map.php file, restarted Nagios - to no avail. Only modifying the common.css had any effect on the status map background color, however, in doing so, I produced two new challenges in that ALL site pages are now black and any black text is obviously now hidden. My main concern is the host labels on the map and so I attempted to locate the css responsible for the hosts' label color but was unable to find it...yet.

For the moment, I've chosen a gray background which still allows me to see the black text enough for it to be legible - while reducing the previously glaring bright white.

I'm just curious, has this sort of request never surfaced before? In this day and age of "high contrast maps are the rage", I'm very surprised that there is not a already a pre-existing theme, option or modification that allows such in Nagios. And if not, that's fine - we'll see what we can do to create one ☺️
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: High Contrast Status Map option

Post by lmiltchev »

I'm just curious, has this sort of request never surfaced before? In this day and age of "high contrast maps are the rage", I'm very surprised that there is not a already a pre-existing theme, option or modification that allows such in Nagios. And if not, that's fine - we'll see what we can do to create one ☺️
There has been some talk about formatting the status map. You are view it here: https://github.com/NagiosEnterprises/na ... /issues/86

Feel free to chime in or open a new feature request if you think you need to. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
discarn8
Posts: 11
Joined: Mon Jul 24, 2017 11:47 pm

Re: High Contrast Status Map option

Post by discarn8 »

Again, thank you very much for the reply and the information.

Would anyone reading this, know in which file that the color values for the host labels resides?

Thanks very much in advance.
discarn8
Posts: 11
Joined: Mon Jul 24, 2017 11:47 pm

Re: High Contrast Status Map option

Post by discarn8 »

I stand corrected... Adding the style formatting to the map.php file did the trick - thanks so very much.

I'm still open to anyone who has a already located the file containing the color values for the map hosts.

If I find it, I'll post it here for future viewers.

Thanks again.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: High Contrast Status Map option

Post by dwhitfield »

discarn8 wrote: If I find it, I'll post it here for future viewers.
Thanks so much! We'll leave this open for now for input from others.

The developer that closed that bug is no longer with Nagios. The current devs may be willing to open it back up. I mention this in case you were wondering why you were pointed to a closed issue.
discarn8
Posts: 11
Joined: Mon Jul 24, 2017 11:47 pm

Re: High Contrast Status Map option

Post by discarn8 »

For anyone else looking to modify their v4.3.2 nagios colors - here is how to modify the nav bar on the left to look like this:
sidebar.png
(IMPORTANT: make sure you clear your browser cache so you don't serve up old copies of the files)

Type the following at the CLI:

root@nagios:$ nano /usr/local/nagios/share/side.php

change the existing body statement to the following:

<body class='navbar' style="background:black">

and add the following to your side.php flle in the <head> content:

<style>
a img {
border: none;
}
a {
text-decoration: none;
color: #00ff00; /*<----------modify this value to change the color of your links */
}
a:hover {
text-decoration: underline;
color: #00ff00; /*<----------modify this value to change the color of your links as you hover over them */
}
a:active {
color: #00ff00; /*<----------modify this value to change the color of your links */
}
a:visited {
color: #19aa19; /*<----------modify this value to change the color of the links you have visited */
}
</style>
discarn8
Posts: 11
Joined: Mon Jul 24, 2017 11:47 pm

Re: High Contrast Status Map option

Post by discarn8 »

As lmiltchev mentioned above, edit the "/usr/local/nagios/share/map.php" file (the "map-container" section) and add the [style="background:#222222"]
map.png
(Note: you can also trade "#222222" for "black", however, until I can figure out how to change the colors of the host labels, they'll "disappear" if you make your background completely black as the text is also black)

<div id="map-container" ng-hide="formDisplayed"
nagios-map
cgiurl="{{params.cgiurl}}"
layout="{{params.layout}}"
dimensions="{{params.dimensions}}"
ulx="{{params.ulx}}"
uly="{{params.uly}}"
lrx="{{params.lrx}}"
lry="{{params.lry}}"
root="params.root"
maxzoom="params.maxzoom"
nolinks="{{params.nolinks}}"
notext="{{params.notext}}"
nopopups="{{params.nopopups}}"
noresize="{{params.noresize}}"
noicons="{{params.noicons}}"
iconurl="{{params.iconurl}}"
reload="{{reload}}"
update-interval="10"
last-update="lastUpdate"
map-width="svgWidth"
map-height="svgHeight"
style="background:#222222"
build="canBuildMap()">
</div>

[Optional]To also change the color of the link lines, edit the following

root@nagios:$ nano /usr/local/nagios/share/stylesheets/map-directive.css


/* Styles for map elements */
.link {
fill: none;
stroke: #00ff00; /*<-----modify this value to suite your color preference */
stroke-width: 1.5px; /*<-----modify this value to suite your link thickness preference */
}
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: High Contrast Status Map option

Post by lmiltchev »

@discarn8, is it safe to close this topic?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked