Ad Widget

Collapse

Zabbix API.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akbar415
    Senior Member
    • May 2015
    • 119

    #1

    Zabbix API.

    hi.

    Is there some way to get zabbix ack message from API? I found nothing in the doc's.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    I think you can get messages by event.get.


    ex.
    Code:
    {
        "jsonrpc": "2.0",
        "method": "event.get",
        "params": {
            "output": "extend",
            "eventids": "47089",
            "select_acknowledges": "extend"
        },
        "auth": "2d28eceae0b3c7a544d68967fdac9a5b",
        "id": 1
    }

    Comment

    • akbar415
      Senior Member
      • May 2015
      • 119

      #3
      Thanks for the help.
      But you can tell me waht I'm doing wrong

      Code:
      EVENT = zapi.event.get(time_from=DATA_INICIO,
                                           time_till=DATA_TERMINO,
                                          output='extend',
                                          source='0',
                                          hostids='10340',
                                          value='1',
                                        select_acknowledges='extend'
                                           )
      
      for t in EVENT:
           print t
      I'm sure that this hostid have comments but the result's show of this script show me otherwise
      Code:
      {u'eventid': u'11580422', u'acknowledges': [], u'objectid': u'23059', u'clock': u'1443927936',
      u'object': u'0', u'acknowledged': u'0', u'value': u'1', u'source': u'0', u'ns': u'681239139'}

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        That event is not acked.
        Because acknowledged value is 0.

        Please try change time scope.

        Comment

        • akbar415
          Senior Member
          • May 2015
          • 119

          #5
          Originally posted by Atsushi
          That event is not acked.
          Because acknowledged value is 0.

          Please try change time scope.
          Thanks dude.

          Comment

          Working...