Nagios Core - Display Filter

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.
Master_Chief_Jon
Posts: 23
Joined: Fri Nov 19, 2010 1:31 pm

Nagios Core - Display Filter

Post by Master_Chief_Jon »

I am currently using a Nagios URL that filters the Services display so that it shows me only services that are NOT OK. The URL for that is cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=29&serviceprops=0
.
The problem is that this only shows when a service check fails, it doesn't show when a host check fails. If I add the filter for hoststatustypes to the URL above, it ANDS the host filter with the service filter, so you have to have the host check fail AND the service check fail before it shows up.
.
Is there a way to OR the host check / service check filter in one URL?
rh42200
Posts: 3
Joined: Thu Jun 21, 2012 2:34 am

Re: Nagios Core - Display Filter

Post by rh42200 »

Master_Chief_Jon wrote:I am currently using a Nagios URL that filters the Services display so that it shows me only services that are NOT OK. The URL for that is cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=29&serviceprops=0
.
The problem is that this only shows when a service check fails, it doesn't show when a host check fails. If I add the filter for hoststatustypes to the URL above, it ANDS the host filter with the service filter, so you have to have the host check fail AND the service check fail before it shows up.
.
Is there a way to OR the host check / service check filter in one URL?

I have the exact same challenge - any solution?
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios Core - Display Filter

Post by jsmurphy »

I may be misunderstanding the problem... but isn't that essentially what the root problem page in Nagios is doing? So if you were to use the URL:
"cgi-bin/status.cgi?host=all&servicestatustypes=28"

Does this do what you are after?
rh42200
Posts: 3
Joined: Thu Jun 21, 2012 2:34 am

Re: Nagios Core - Display Filter

Post by rh42200 »

jsmurphy wrote:I may be misunderstanding the problem... but isn't that essentially what the root problem page in Nagios is doing? So if you were to use the URL:
"cgi-bin/status.cgi?host=all&servicestatustypes=28"

Does this do what you are after?
I see now, that I was not accurate enough in my last post... The root problem page as well as your URL shows the same - what I am really after is just that, but with acknowledged problems filtered out. So I'd like to see only the unacknowledged host problems and the unacknowledged service problems in one page.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios Core - Display Filter

Post by jsmurphy »

Ohhh I see, I think if you use: "status.cgi?host=all&type=detail&servicestatustypes=28&serviceprops=10&hostprops=10" that will give you exactly what you want.

I think it's using bitwise operations to work out what to display, so basically add the numbers below together to display what you want:
#servicestatustypes=
Ok - 2
Warning - 4
Unknown - 8
Critical - 16
(28 is all except ok)

#hoststatustypes=
Up - 2
Down - 4
Unreachable - 8

#host/serviceprops= (This one has more but these are probably the two you care about)
No scheduled downtime - 2
Unacknowledged - 8
(10 is unknown problems)
rh42200
Posts: 3
Joined: Thu Jun 21, 2012 2:34 am

Re: Nagios Core - Display Filter

Post by rh42200 »

jsmurphy wrote:Ohhh I see, I think if you use: "status.cgi?host=all&type=detail&servicestatustypes=28&serviceprops=10&hostprops=10" that will give you exactly what you want.
Ahhh, yes, this is exactly what I needed! :D

Are you able to supply me with a link to somewhere I can get an overview of all values for statustypes and props, and some information telling me if a given value is relevant as a prop or a statustype for a service or host? I have tried to find some good documentation for this on Uncle Google, and did find some values and their meaning, but nothing on in which context (hostprop, hoststatustype, serviceprop or servicestatustype) they were relevant...
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios Core - Display Filter

Post by jsmurphy »

I have seen this question asked a few times so when I saw it again yesterday I actually wrote a blog post detailing exactly that ;) : http://roshamboot.org/main/?p=74
Master_Chief_Jon
Posts: 23
Joined: Fri Nov 19, 2010 1:31 pm

Re: Nagios Core - Display Filter

Post by Master_Chief_Jon »

jsmurphy - I am the original poster. Your solution works when there is a service check failure regardless of what the host status is (that's good); but if there is a host check failure and NOT a service check failure, then the error doesn't appear on the status.cgi screen.
That's because the two pieces (host=all and servicestatustypes=28) are AND-ed together. I'm asking is there a way to OR them together.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core - Display Filter

Post by lmiltchev »

jsmurphy already answered this:
Note: As far as I know there is no way to do an “OR” so you can’t do “I want it to display only the server if its down OR the critical services if it is not”.
http://roshamboot.org/main/?p=74
Be sure to check out our Knowledgebase for helpful articles and solutions!
jon2jay
Posts: 6
Joined: Mon Aug 14, 2017 2:31 pm

Re: Nagios Core - Display Filter

Post by jon2jay »

Blog posting above displays white screen.

Need assistance on this also -- also need the ability to filter out services/hosts from specific groups.
Locked