Zabbix Documentation 4.2

3.04.04.24.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.4Guidelines

User Tools

Site Tools


manual:api:reference:event:get

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:api:reference:event:get [2018/05/22 09:35]
vmurzins
manual:api:reference:event:get [2019/01/28 14:51] (current)
sasha <code js> => <code java>
Line 7: Line 7:
 The method allows to retrieve events according to the given parameters. The method allows to retrieve events according to the given parameters.
  
 +<note important>​This method may return events of a deleted entity if these events have not been removed by the housekeeper yet.</​note>​
 ==== Parameters ==== ==== Parameters ====
  
Line 23: Line 24:
 | object | integer | Return only events created by objects of the given type. \\ \\ Refer to the  [[object#​event|event object page]] for a list of supported object types. \\ \\ Default: 0 - trigger. | | object | integer | Return only events created by objects of the given type. \\ \\ Refer to the  [[object#​event|event object page]] for a list of supported object types. \\ \\ Default: 0 - trigger. |
 | acknowledged | boolean | If set to ''​true''​ return only acknowledged events. | | acknowledged | boolean | If set to ''​true''​ return only acknowledged events. |
-| severities | integer/​array | Return only events with given trigger ​severities. Applies only if object is trigger. | +| suppressed | boolean | ''​true''​ - return only suppressed events; \\ ''​false''​ - return events in the normal state. | 
-| evaltype ​  | integer ​      | Rules for tag searching. \\ \\ Possible values: \\ 0 - (default) ​AND; \\ OR.        | +| severities | integer/​array | Return only events with given event severities. Applies only if object is trigger. | 
-| tags       ​| ​object ​| Return only events with given tags. Exact match by tag and case-insensitive search by value and operator. \\ Format: ''<​nowiki>​[{"​tag":​ "<​tag>",​ "​value":​ "<​value>",​ "​operator":​ "<​operator>"​},​ ...]</​nowiki>''​.\\ An empty array returns all events. \\ \\ Possible operator types: \\ 0 - (default) Like; \\ 1 - Equal.|+| evaltype ​  | integer ​      | Rules for tag searching. \\ \\ Possible values: \\ 0 - (default) ​And/Or; \\ Or.        | 
 +| tags       ​| ​array of objects ​| Return only events with given tags. Exact match by tag and case-insensitive search by value and operator. \\ Format: ''<​nowiki>​[{"​tag":​ "<​tag>",​ "​value":​ "<​value>",​ "​operator":​ "<​operator>"​},​ ...]</​nowiki>''​.\\ An empty array returns all events. \\ \\ Possible operator types: \\ 0 - (default) Like; \\ 1 - Equal.|
 | eventid_from | string | Return only events with IDs greater or equal to the given ID. | | eventid_from | string | Return only events with IDs greater or equal to the given ID. |
 | eventid_till | string | Return only events with IDs less or equal to the given ID. | | eventid_till | string | Return only events with IDs less or equal to the given ID. |
 | time_from | timestamp | Return only events that have been created after or at the given time. | | time_from | timestamp | Return only events that have been created after or at the given time. |
 | time_till | timestamp | Return only events that have been created before or at the given time. | | time_till | timestamp | Return only events that have been created before or at the given time. |
 +| problem_time_from | timestamp | Returns only events that were in the problem state starting with ''​problem_time_from''​. Applies only if the source is trigger event and object is trigger. Mandatory if ''​problem_time_till''​ is specified.|
 +| problem_time_till | timestamp | Returns only events that were in the problem state until ''​problem_time_till''​. Applies only if the source is trigger event and object is trigger. Mandatory if ''​problem_time_from''​ is specified.|
 | value | integer/​array | Return only events with the given values. | | value | integer/​array | Return only events with the given values. |
 ^ ||| ^ |||
Line 35: Line 39:
 | selectRelatedObject | query | Return the object that created the event in the ''​relatedObject''​ property. ​ The type of object returned depends on the event type. | | selectRelatedObject | query | Return the object that created the event in the ''​relatedObject''​ property. ​ The type of object returned depends on the event type. |
 | select_alerts | query | Return alerts generated by the event in the ''​alerts''​ property. Alerts are sorted in reverse chronological order. | | select_alerts | query | Return alerts generated by the event in the ''​alerts''​ property. Alerts are sorted in reverse chronological order. |
-| select_acknowledges | query | Return event'​s ​acknowledges ​in the ''​acknowledges''​ property. ​Acknowledges ​are sorted in reverse chronological order. \\ \\ The event acknowledgement ​object has the following properties: \\ ''​acknowledgeid''​ - ''​(string)''​ acknowledgement'​s ID; \\ ''​userid''​ - ''​(string)''​ ID of the user that updated the event; \\ ''​eventid''​ - ''​(string)''​ ID of the updated event; \\ ''​clock''​ - ''​(timestamp)''​ time when the event was updated; \\ ''​message''​ - ''​(string)''​ text of the message; \\ ''​action''​ - ''​(integer)''​ update action that was performed see [[manual:​api:​reference:​event:​acknowledge|event.acknowledge]];​ \\ ''​old_severity''​ - ''​(integer)''​ event severity before this update action; \\ ''​new_severity''​ - ''​(integer)''​ event severity after this update action; \\ ''​alias''​ - ''​(string)''​ alias of the user that updated the event; \\ ''​name''​ - ''​(string)''​ name of the user that updated the event; \\ ''​surname''​ - ''​(string)''​ surname of the user that updated the event. \\  \\ Supports ''​count''​. |+| select_acknowledges | query | Return event'​s ​updates ​in the ''​acknowledges''​ property. ​Event updates ​are sorted in reverse chronological order. \\ \\ The event update ​object has the following properties: \\ ''​acknowledgeid''​ - ''​(string)''​ acknowledgement'​s ID; \\ ''​userid''​ - ''​(string)''​ ID of the user that updated the event; \\ ''​eventid''​ - ''​(string)''​ ID of the updated event; \\ ''​clock''​ - ''​(timestamp)''​ time when the event was updated; \\ ''​message''​ - ''​(string)''​ text of the message; \\ ''​action''​ - ''​(integer)''​ update action that was performed see [[manual:​api:​reference:​event:​acknowledge|event.acknowledge]];​ \\ ''​old_severity''​ - ''​(integer)''​ event severity before this update action; \\ ''​new_severity''​ - ''​(integer)''​ event severity after this update action; \\ ''​alias''​ - ''​(string)''​ alias of the user that updated the event; \\ ''​name''​ - ''​(string)''​ name of the user that updated the event; \\ ''​surname''​ - ''​(string)''​ surname of the user that updated the event. \\  \\ Supports ''​count''​. |
 | selectTags | query | Return event tags in ''​tags''​ property. | | selectTags | query | Return event tags in ''​tags''​ property. |
 +| selectSuppressionData | query | Return list of maintenances in the ''​suppression_data''​ property: \\ ''​maintenanceid''​ - ''​(string)''​ ID of the maintenance;​ \\ ''​suppress_until''​ - ''​(integer)''​ time until the event is suppressed. |
 ^ ||| ^ |||
 | sortfield | string/​array | Sort the result by the given properties. \\ \\ Possible values are: ''​eventid'',​ ''​objectid''​ and  ''​clock''​. | | sortfield | string/​array | Sort the result by the given properties. \\ \\ Possible values are: ''​eventid'',​ ''​objectid''​ and  ''​clock''​. |
Line 64: Line 69:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 72: Line 77:
         "​select_acknowledges":​ "​extend",​         "​select_acknowledges":​ "​extend",​
         "​selectTags":​ "​extend",​         "​selectTags":​ "​extend",​
 +        "​selectSuppressionData":​ "​extend",​
         "​objectids":​ "​13926",​         "​objectids":​ "​13926",​
         "​sortfield":​ ["​clock",​ "​eventid"​],​         "​sortfield":​ ["​clock",​ "​eventid"​],​
Line 82: Line 88:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 94: Line 100:
                     "​clock":​ "​1350640590",​                     "​clock":​ "​1350640590",​
                     "​message":​ "​Problem resolved.\n\r----[BULK ACKNOWLEDGE]----",​                     "​message":​ "​Problem resolved.\n\r----[BULK ACKNOWLEDGE]----",​
-                    "​alias":​ "​Admin"​+                    ​"​action":​ "​6",​ 
 +                    "​old_severity":​ "​0",​ 
 +                    "​new_severity":​ "​0",​ 
 +                    ​"​alias":​ "Admin", 
 +                    "​name":​ "​Zabbix",​ 
 +                    "​surname":​ "​Administrator"
                 }                 }
             ],             ],
Line 104: Line 115:
             "​value":​ "​1",​             "​value":​ "​1",​
             "​acknowledged":​ "​1",​             "​acknowledged":​ "​1",​
 +            "​suppressed":​ "​1",​
             "​ns":​ "​413316245",​             "​ns":​ "​413316245",​
             "​name":​ "MySQL is down",             "​name":​ "MySQL is down",
 +            "​severity":​ "​5",​
             "​r_eventid":​ "​0",​             "​r_eventid":​ "​0",​
             "​c_eventid":​ "​0",​             "​c_eventid":​ "​0",​
Line 118: Line 131:
                     "​tag":​ "​error",​                     "​tag":​ "​error",​
                     "​value":​ ""​                     "​value":​ ""​
 +                }
 +            ],
 +            "​suppression_data":​ [
 +                {
 +                    "​maintenanceid":​ "​15",​
 +                    "​suppress_until":​ "​1472511600"​
                 }                 }
             ]             ]
Line 130: Line 149:
             "​value":​ "​0",​             "​value":​ "​0",​
             "​acknowledged":​ "​0",​             "​acknowledged":​ "​0",​
 +            "​suppressed":​ "​0",​
             "​ns":​ "​0",​             "​ns":​ "​0",​
             "​name":​ "​Unavailable by ICMP ping",             "​name":​ "​Unavailable by ICMP ping",
 +            "​severity":​ "​4",​
             "​r_eventid":​ "​0",​             "​r_eventid":​ "​0",​
             "​c_eventid":​ "​0",​             "​c_eventid":​ "​0",​
             "​correlationid":​ "​0",​             "​correlationid":​ "​0",​
             "​userid":​ "​0",​             "​userid":​ "​0",​
-            "​tags":​ []+            "tags": [], 
 +            "​suppression_data": []
         }         }
     ],     ],
Line 148: Line 170:
  
 Request: Request:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 165: Line 187:
  
 Response: Response:
-<​code ​js>+<​code ​java>
 { {
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
Line 177: Line 199:
             "​value":​ "​1",​             "​value":​ "​1",​
             "​acknowledged":​ "​0",​             "​acknowledged":​ "​0",​
 +            "​suppressed":​ "​0",​
             "​ns":​ "​0",​             "​ns":​ "​0",​
             "​name":​ "Less than 25% free in the history cache",​             "​name":​ "Less than 25% free in the history cache",​
 +            "​severity":​ "​3",​
             "​r_eventid":​ "​0",​             "​r_eventid":​ "​0",​
             "​c_eventid":​ "​0",​             "​c_eventid":​ "​0",​
Line 192: Line 216:
             "​value":​ "​0",​             "​value":​ "​0",​
             "​acknowledged":​ "​0",​             "​acknowledged":​ "​0",​
 +            "​suppressed":​ "​0",​
             "​ns":​ "​0",​             "​ns":​ "​0",​
             "​name":​ "​Zabbix trapper processes more than 75% busy",             "​name":​ "​Zabbix trapper processes more than 75% busy",
 +            "​severity":​ "​3",​
             "​r_eventid":​ "​0",​             "​r_eventid":​ "​0",​
             "​c_eventid":​ "​0",​             "​c_eventid":​ "​0",​
Line 207: Line 233:
             "​value":​ "​1",​             "​value":​ "​1",​
             "​acknowledged":​ "​0",​             "​acknowledged":​ "​0",​
 +            "​suppressed":​ "​0",​
             "​ns":​ "​0",​             "​ns":​ "​0",​
             "​name":​ "High ICMP ping loss",             "​name":​ "High ICMP ping loss",
 +            "​severity":​ "​3",​
             "​r_eventid":​ "​0",​             "​r_eventid":​ "​0",​
             "​c_eventid":​ "​0",​             "​c_eventid":​ "​0",​