RE: [Nagios-devel] PATCH: Service Hard/Soft State Filter for

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

RE: [Nagios-devel] PATCH: Service Hard/Soft State Filter for

Post by Guest »

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 ... tustypes=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 ... pes=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 ... pes=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: [email protected]
>> [mailto:[email protected]] On Behalf
>> Of Bob Ingraham
>> Sent: Tuesday, May 16, 2006 6:03 AM
>> To: [email protected]
>> 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
>>
>>
>>
>









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