Change graph Colors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
r.jaynes
Posts: 58
Joined: Wed May 19, 2010 1:27 pm

Change graph Colors

Post by r.jaynes »

This may seem like a simple request, but I'm unable to find where to change the graph colors. I've dug through the config files in /usr/local/nagios/etc/pnp, searched through the forums and FAQ's, searched around online, etc., but so far no luck. We have had a regular MRTG server for a few years, and our network guys would like to match the colors of the Nagios graphs to our existing MRTG graphs.

System info:
Nagios XI 2009R1.3F
VMWare Image, vanilla install (No SSL, no Gnome)

Thank you!
r.jaynes
Posts: 58
Joined: Wed May 19, 2010 1:27 pm

Re: Change graph Colors

Post by r.jaynes »

Maybe I should have clarified my question a bit further, and one more google search: Do I need to update colors in /etc/mrtg/mrtg.cfg? If I update the values there, do I need to restart the "Performance grapher" from the Nagios XI "Admin" page?
r.jaynes
Posts: 58
Joined: Wed May 19, 2010 1:27 pm

Re: Change graph Colors

Post by r.jaynes »

Update: I have updated /etc/mrtg/mrtg.cfg with the following line for this particular switch:

Colours[10.2.131.20_4]: BROWN#FF972B,GRAY#AAAAAA,BLUE#1000FF,VIOLET#FF00FF

Per the documentation at http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html, and restarted the performance grapher, and it isn't updating the colors on the graph. Am I not restarting the right service?
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Change graph Colors

Post by rdedon »

Could you restart the httpd service, and if no result, stop/start nagiosxi as well please? Also, just on a whim, could you clear the cache of the browser as well after each change to test please?

Thank you.
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Change graph Colors

Post by mguthrie »

I've never actually done this myself, but this gets into graph templates with PNP. You might have to do some digging in the PNP docs to find what you need.

http://docs.pnp4nagios.org/pnp-0.4/start

Look for the section on templating. Sorry I can't give you more detail than that, I've never actually messed with it myself, but I know you can change the default templates, I'll do some more snooping around and see if I can find where they're at.

I think Cacti is also a front-end for graph templating, I would do some hunting on that as well.
r.jaynes
Posts: 58
Joined: Wed May 19, 2010 1:27 pm

Re: Change graph Colors

Post by r.jaynes »

mguthrie: That link got it. I edited /usr/local/nagios/share/pnp/templates/check_xi_service_mrtgtraf.php, and replaced the hex values for the colors. Without having to restart nagios or any of it's services, I scheduled an immediate check, and as soon as it redrew the graph it was correct. The next thing on my list to figure out is how to include percentages of bandwidth used in relation to total bandwidth. Our MRTG setup has this on by default as well. Thanks for the link and I think I can take it from here!
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Change graph Colors

Post by rdedon »

Thanks for the update! :-)
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com