[Nagios-devel] Display hosts with WARNING/CRITICAL services in another color

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.
Locked
Guest

[Nagios-devel] Display hosts with WARNING/CRITICAL services in another color

Post by Guest »

Hi,
I wrote a simple two line patch for statusmap.cgi to display hosts with
services wich are in a warning or critical state in another color.

We use this for a central network monitoring display, so the admins can see
if a service on a host goes down too and not just if the physical machine
fails as in the "normal" statusmap.cgi.

Furthermore I changed the "HOST_UP" an "HOST_DOWN" colors (from lightred to
red, and from lightgreen to green) because of the higher conrasts on the
display.

I'll be happy if this could be useful for somebody else, but don't be to
hard to me, my C skills are as bad as my english knowledge ;)

Regards
Andreas

Diff to Nagios 1.2 statusmap.c file:

@@ -2889,9 +2889,21 @@ void draw_circular_layer_markup(host *pa
if(temp_hoststatus==NULL)
bgcolor=color_lightgrey;
else if(temp_hoststatus->status==HOST_DOWN ||
temp_hoststatus->status==HOST_UNREACHABLE)
- bgcolor=color_lightred;
+
+ /* Ha, Original: bgcolor=color_lightred;*/
+ bgcolor=color_red;
+
+ /*Ha, Paint yellow background if one ore more
services on that host are CRITICAL */
+ else if
(get_servicestatus_count(temp_host->name,SERVICE_CRITICAL)>0)
+ bgcolor=color_yellow;
+
+ /*Ha, Paint orange background if one ore more
services on that host are WARNING */
+ else if
(get_servicestatus_count(temp_host->name,SERVICE_WARNING)>0)
+ bgcolor=color_orange;
+
else
- bgcolor=color_lightgreen;
+ /* Ha, Original: bgcolor=color_lightgreen;*/
+ bgcolor=color_green;

/* fill slice with background color */
/* the fill function only works with coordinates
that are in bounds of the actual image */




BITBURGER BRAUEREI TH. SIMON GmbH
KIS/Systeme und Kommunikation, Service und Support/Andreas Husch
Römermauer 3, 54634 Bitburg
Tel. 06561 14-3540 Fax: 06561 14-83540
E-Mail: [email protected]
Besuchen Sie uns im Internet:








This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked