Ad Widget

Collapse

API : get the worst current trigger severity ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tiramiseb
    Senior Member
    • Sep 2012
    • 427

    #1

    API : get the worst current trigger severity ?

    Hello,

    I will maybe try to create a Zabbix extensions for GNOME Shell.

    This extension would display an icon on the top bar, showing the worst current trigger severity in Zabbix ; clicking on the icon would open a browser window with the Zabbix frontend.

    Is there an API method that would simply return the worst current trigger severity ?


    In a second version, I would like to display a list of triggers when clicking on the icon - I think I've already found information I need in the API doc for this part.


    If there is no API method to simply get the worst current severity, I will directly switch to this second version - but I may need way more time before I have something working.



    (please note I don't promise I will do that : I have never developed GNOME extensions, I need to learn it and can't tell for the moment if I will be able to maintain it)
    Traducteur principal de Zabbix en français ces derniers temps - Blog personnel - Boutique de domotique "DIY"
  • qix
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2006
    • 423

    #2
    I don't think that kind of query currently exists, but you'll need to check the documentation.
    What you probably need to do is fetch all the active triggers and filter on the severity field or sort the result afterwards using that field.
    With kind regards,

    Raymond

    Comment

    • tiramiseb
      Senior Member
      • Sep 2012
      • 427

      #3
      Originally posted by qix
      I don't think that kind of query currently exists, but you'll need to check the documentation.
      I didn't find anything that would look like that in the documentation

      Originally posted by qix
      What you probably need to do is fetch all the active triggers and filter on the severity field or sort the result afterwards using that field.
      That's what I thought. So I may directly try to create the "second version" : if I have all this information, it's just a matter of displaying it.
      Traducteur principal de Zabbix en français ces derniers temps - Blog personnel - Boutique de domotique "DIY"

      Comment

      • Pavels
        Member
        • Oct 2011
        • 83

        #4
        Qix is right. Heres an example of the request:

        Code:
        {
            "output": [
                "priority"
            ],
            "filter": {
                "value": 1
            },
            "sortfield": "priority",
            "sortorder": "DESC",
            "limit": 1
        }
        It returns a trigger in active state with the highest severity.

        Comment

        • tiramiseb
          Senior Member
          • Sep 2012
          • 427

          #5
          Thanks Pavels !

          I didn't think of this approach
          Traducteur principal de Zabbix en français ces derniers temps - Blog personnel - Boutique de domotique "DIY"

          Comment

          Working...