this is basically a follow-up question to this post of mine.
My goal is to show ALL critical services in Dashing where the corresponding host is NOT currently in a downtime-state and the service is NOT acknowledged.
I verified that I am querying the right attributes of my host objects, and the code should work as well, thing is, it doesn’t.
I do not know my way around Ruby all too well, so a proofreading of the lines in question would be very nice!
services = icinga.getServiceObjects(["__name", "state", "acknowledgement", "host"], nil, ["host.downtime_depth"]) service_problems = 0 services.each do |service| if(service["attrs"]["state"] > 0 && service["attrs"]["acknowledgement"] == 0 && service["joins"]["host.downtime_depth"] == 0.0) service_problems += 1 end end
‘service_problems’ gets pushed to a meter-widget within my dashboard, this is the simplest example using this filtering query, even though I intend to use it in many places throughout my code.
Shouldn’t this do the trick? Anything I’m missing?
Thanks in regards,