statusmap patch reflects service status

Cook, Garry GWCOOK at mactec.com
Wed Sep 24 20:23:11 CEST 2003


Has anyone been able to make this work? I've got a client that has been
asking for this feature for months now, I'd really like to be able to
give it to him.

I patched statusmap.c, recompiled, and copied the statusmap.cgi to
nagios/sbin, however I don't see any difference in the statusmap and I
have plenty of services in a warning state.

Just to be clear, this patch should change the background color of the
HOST, right?

Garry W. Cook, CCNA
Network Infrastructure Manager
MACTEC, Inc. - http://www.mactec.com/
303.308.6228 (Office) - 720.220.1862 (Mobile) 

> -----Original Message-----
> From: Dan Barber [mailto:danb at mojolin.com] 
> Sent: Tuesday, September 23, 2003 11:04 AM
> To: nagios-users at lists.sourceforge.net
> Cc: jaos at jaos.org
> Subject: [Nagios-users] statusmap patch reflects service status
> 
> 
> Hello all,
> 
> Here is a patch to statusmap.c which will refelect the status 
> of services in the background color.  IE, the background 
> color will change to yellow if there are any service 
> warnings.  The word "Up" will remain green as long as 
> connectivity is still good.
> 
> Here's the patch... should be a simple:
> copy patch to cgi dir in your nagios source directory:  
> nagios-1.1/cgi patch -p0 < patch_file.diff recompile and 
> reinstall or just copy the new statusmap.cgi to your working cgi-bin
> 
> Thanks go to Jason Woodward (http://jaos.org) for the coding.
> 
> The patch (patch_file.diff):
> 
> --- statusmap.c 2002-10-25 04:58:17.000000000 +0000
> +++ modified_statusmap.c  2003-09-23 10:54:06.000000000 +0000
> @@ -2882,8 +2882,23 @@
>       temp_hoststatus=find_hoststatus(temp_host->name);
>       if(temp_hoststatus==NULL)
>         bgcolor=color_lightgrey;
> -     else if(temp_hoststatus->status==HOST_DOWN ||
> temp_hoststatus->status==HOST_UNREACHABLE)
> +     else if(temp_hoststatus->status==HOST_DOWN ||
> temp_hoststatus->status==HOST_UNREACHABLE ||
> +       (
> +         (
> +           get_servicestatus_count(temp_host->name,SERVICE_CRITICAL)
> +           + 
> get_servicestatus_count(temp_host->name,SERVICE_UNREACHABLE)
> +           + 
> get_servicestatus_count(temp_host->name,SERVICE_HOST_DOWN)
> +         ) > 0
> +       )
> +     )
>         bgcolor=color_lightred;
> +     else if(
> +       (
> +         get_servicestatus_count(temp_host->name,SERVICE_WARNING)
> +         + get_servicestatus_count(temp_host->name,SERVICE_UNKNOWN)
> +       ) > 0
> +     )
> +       bgcolor=color_yellow;
>       else
>         bgcolor=color_lightgreen;
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf 
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS 
> when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list