Ad Widget

Collapse

API: Get all the triggers that are currently in "PROBLEM" status

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jherazob
    Junior Member
    • Sep 2011
    • 20

    #1

    API: Get all the triggers that are currently in "PROBLEM" status

    I'm still wrapping my head around the API, but here's an important type of query i'd like to get and i still can't figure out how to ask for:

    Give me all the triggers that are right now in "PROBLEM" status.

    I suspect this is possible using the Event.get() filtering by value, but if a trigger fired and later went back to normal i won't know since Event seems to be pretty much a log of fired triggers and generates one entry for when a trigger fired and another for when it comes back to normal.

    There's the added complication that a trigger may be too long-lived for a given time period. If, say, a host went low on space and a Warning trigger fired about it, but no one has solved that one yet in the last couple of days, if i limit the query to Event i won't even find out about that one.

    Summary: How can i make the API tell me what's wrong right now?
  • jherazob
    Junior Member
    • Sep 2011
    • 20

    #2
    For those in the future looking for this, Trigger.get() lets you use "value" as a filter, value 0 is OK, value 1 is PROBLEM.

    Comment

    Working...