Ad Widget

Collapse

trigget.get doesn't show the right problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daven1985
    Junior Member
    • Aug 2017
    • 12

    #1

    trigget.get doesn't show the right problems

    I'm trying to get Zabbix Problems by API for use on a dashboard. However when I try to run them I get the wrong data.

    For example right now the Zabbix Dashboard says....

    0 Disaster

    18 High

    7 Average

    3 Warning

    5 Information

    0 Not Classified



    When I run the below JSON Query I get...

    0 Disaster

    19 High

    8 Average

    3 Warning

    3 Information

    0 Not Classified



    At the moment I am not the issue seems to be they aren't right and ignoring the only unacknowledged. Anyone able to help?



    Cheers.



    Code:
    {
    
    "jsonrpc": "2.0",
    
    "method": "trigger.get",
    
    "params": {
    
    "countOutput": true,
    
    "output": ["triggerid", "description", "priority", "select_severity"],
    
    "filter": {
    
    "value": 1,
    
    "acknowledged": 0,
    
    "priority": 5
    
    },
    
    "skipDependent": 1,
    
    "monitored": 1,
    
    "only_true": 1
    
    },
    
    "auth": "---",
    
    "id": 1,
    
    "jsonrpc": "2.0"
    
    }
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    Click image for larger version

Name:	Screenshot 2024-02-06 at 11.38.26.png
Views:	241
Size:	22.0 KB
ID:	478446 Do you see this in the Problems widget configuration?

    Comment

    • daven1985
      Junior Member
      • Aug 2017
      • 12

      #3
      Originally posted by dimir
      Click image for larger version  Name:	Screenshot 2024-02-06 at 11.38.26.png Views:	2 Size:	22.0 KB ID:	478446 Do you see this in the Problems widget configuration?
      No. Here are the settings I see.

      Click image for larger version

Name:	image.png
Views:	150
Size:	139.0 KB
ID:	478455​I think the issue is I have disabled triggers that weren't acknowledged, is there even a way to clear them?

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        There should be a Problem display with possible options All, Separated, Unacknowledged only: https://www.zabbix.com/documentation...blems_severity

        Which version of Zabbix is this?
        Last edited by dimir; 06-02-2024, 12:53.

        Comment

        • daven1985
          Junior Member
          • Aug 2017
          • 12

          #5
          Latest stable release.

          I believe the issue is that one of the admins when problems would come up would just disable the alert if not needed.

          So I think I have disabled alerts that weren’t cleared. Any idea how to clear them without going through each trigger. I have thousands.

          I can get a list of their ID, can I search a trigger ID?

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            Originally posted by daven1985
            I can get a list of their ID, can I search a trigger ID?

            if you have problemid, you should be able to pull objectid, which in this case is the trigger id. But you still need to go and enable trigger and then do something about that problem and then you can disable it again .. Problems cannot be modified over API

            Comment

            • gcalenko
              Zabbix developer
              • Mar 2017
              • 27

              #7
              You can get triggers ids from problem.get API:
              Code:
              {
                  "jsonrpc": "2.0",
                  "method": "problem.get",
                  "params": {
                      "output": ["objectid"],
                      "source": 0,
                      "acknowledged": false,
                      "suppressed": true
                  },
                  "auth": "{{token}}",
                  "id": 1
              }​

              Comment

              • daven1985
                Junior Member
                • Aug 2017
                • 12

                #8
                So I find out how to get it working.

                I went to the below URl and could search for all Disabled Triggers. I then enabled them all back, and could then Close/Acknowledge those that were causing issues.

                https://URL/zabbix/triggers.php?cont...0%5D%5Btag%5D= &f ilter_tags%5B0%5D%5Boperator%5D=0&filter_tags%5B0% 5D%5Bvalue%5D=&filter_inherited=-1&filter_discovered=-1&filter_dependent=-1&filter_set=1
                The only outstanding bug I couldn't find figure out was Warning had 3 additional values that did not relate to anything. Even running the command to see their TriggerID brought up ones that did not exist. So I simply added a subtract 3 from the query.

                Thanks all who provided feedback.

                This is on the way for me building an iOS App that will give me data like Problems by Severity as Widgets.​

                Comment

                Working...