PATCH: Service Hard/Soft State Filter for status.cgi

Bob Ingraham bobi at netshel.net
Tue May 16 18:49:17 CEST 2006


Hi,

No, it's not dumb at all.  The problem is that the status.cgi requires
that you "hand-roll" your service_status_types filter yourself - there is
no web-page containing a list of filters to choose from.

So, to enable filters, you would manually construct an URL like:

http://myhost/nagios/cgi-bin/status.cgi?host=all&servicestatustypes=X

Where "X" is the mathematical sum of all of the desired service status
filters.

Here is the list of available filters:

SERVICE_SCHEDULED_DOWNTIME	1
SERVICE_NO_SCHEDULED_DOWNTIME	2
SERVICE_STATE_ACKNOWLEDGED	4
SERVICE_STATE_UNACKNOWLEDGED	8
SERVICE_CHECKS_DISABLED	        16
SERVICE_CHECKS_ENABLED	        32
SERVICE_EVENT_HANDLER_DISABLED	64
SERVICE_EVENT_HANDLER_ENABLED	128
SERVICE_FLAP_DETECTION_ENABLED	256
SERVICE_FLAP_DETECTION_DISABLED	512
SERVICE_IS_FLAPPING	        1024
SERVICE_IS_NOT_FLAPPING	        2048
SERVICE_NOTIFICATIONS_DISABLED	4096
SERVICE_NOTIFICATIONS_ENABLED	8192
SERVICE_PASSIVE_CHECKS_DISABLED	16384
SERVICE_PASSIVE_CHECKS_ENABLED	32768
SERVICE_PASSIVE_CHECK	        65536
SERVICE_ACTIVE_CHECK	        131072
SERVICE_STATE_TYPE_SOFT	        262144
SERVICE_STATE_TYPE_HARD	        524288


So, to see only HARD states, you'd substitute 524288 for "X" in the URL:

http://myhost/nagios/cgi-bin/status.cgi?host=all&servicestatustypes=524288

As a further example of the additive property of filters, you could choose
a combination of services that are *not* in scheduled downtime *and*
services that are in a SOFT state.

In this case "X" = 2 + 262144 = 262146:

http://myhost/nagios/cgi-bin/status.cgi?host=all&servicestatustypes=262146

Please let me know if this doesn't work as advertised.

Bob

PS: I like your UNIX Jedi quote...  :-)


> Hello Bob,
>
> sorry for this (maybe) dumb question....  how can i see the results of
this patch?  i tried it, but don't see any additional information in any
of my status-views...
>
> in status.c i saw that they will be displayed only when "filters"
apply... how could i do that?
>
> thanks a lot,
> christian
>
> --
> "I sense much NT in you, NT leads to Blue Screen.
> Blue Screen leads to downtime, downtime leads to suffering. NT is the
path to the darkside."
>
> - Unknown Unix Jedi
>
>> -----Original Message-----
>> From: nagios-devel-admin at lists.sourceforge.net
>> [mailto:nagios-devel-admin at lists.sourceforge.net] On Behalf
>> Of Bob Ingraham
>> Sent: Tuesday, May 16, 2006 6:03 AM
>> To: nagios-devel at lists.sourceforge.net
>> Subject: [Nagios-devel] PATCH: Service Hard/Soft State Filter
>> for status.cgi
>>
>> Gents,
>>
>> We needed to filter our Service Checks by state-type
>> (Hard/Soft) in our
>> status.cgi display.
>>
>> I've been asked to post this as a patch submission for those
>> who might be
>> interested in this functionality.
>>
>> Please find attached two unified-diff patch files:
>>
>> 1. cgi/status.c - enables state-type filtering
>> 2. include/cgiutils.h.in - adds constants for state-type filters
>>
>> Bob
>>
>>
>>
>






-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list