×
Event - Listing
Parameters Copied
cols
— defines which columns of data to return. Acceptable values:hostname
,time
,objectid
,servicename
,state
,state_type
,output
,eventid
,host_group
,host_group_id
,alias
,ip
,markdown_filter
,htid
,bcid
,bsid
. Some columns will always be returned. For multiple columns, usecols=state&cols=hostname
.startTime
— filter by start time, eg.2011-11-01 18:43:22
. Time is based on the server’s timezone.endTime
— filter by end time.rows
— the number of rows to return.page
— which page of data to return.sortby
— a json structure to describe the ordering of results. Defaults to[{“col”:“time”,”order”:“desc”}]
.host_state
— host states to filter on. Can be repeated. Acceptable values: up/0, down/1, unreachable/2.service_state
— service states to filter on. Can be repeated. Acceptable values: ok/0, warning/1, critical/2, unknown/3.host
— host names to filter on. Can be repeated.service - service
— service names to filter on. This can be repeated.
Note
There is a limitation if you filter by service name only; the results yield for all hosts, whether they have the specified service or not.
serviceonly
— if set, will only return services. Otherwise returns host as well as service events. Default unset.state_type
— state type to filter on. Acceptable values: soft/0, hard/1.hostgroupid
— host group ID to filter on. This ID can be specified at any hierarchical level and it will search all sub-host groups. This can be repeated.
Note
For backward compatibility, thehost_group
parameter can be used as an alternative, but this parameter will be removed in future releases.
keyword
— keyword to filter on. Can be repeated.htid
— host template ID. Can be repeated.bsid
— business service ID. Can be repeated.bcid
— business component ID. Can be repeated.search
— search terms. Will search in host name, service name or output. Can be repeated to produce an AND effect.saved_maxeventid
— if set with the value of the last max event id, an extra attribute will be in the result to signify the number of new events since the last max event id (based on the filtering parameters).eventtype
— there are 4 types of events: 0 = state change event; 1 = acknowledgements event; 2 = downtime start event; 3 = downtime end event. If no eventtype is specified, only eventtype=0 is returned, otherwise specify multiple times to get different types added.include_max
— if set to 0, will not include the max id data. This can be much quicker on the database to not run this query. Defaults to 1.include_page_summary
— if set to 0, will not include the page number data. This can be much quicker on the database to not run this query. Defaults to 1.
Example response Copied
{
"list" : [
{
"eventid" : "9373",
"eventtype" : "0", # State change event
"markdown" : "0",
"objectid" : "194",
"output" : "OK - load average: 1.53, 1.73, 1.58",
"servicename" : "Check Loadavg",
"state" : "ok",
"state_type" : "hard",
"time" : "1248858348"
},
{
"ack_author" : "admin",
"ack_comment" : "Due to power failure",
"eventid" : "9372",
"eventtype" : "1",
"objectid" : "194",
"servicename" : "Check Loadavg",
"state" : "ok",
"state_type" : "hard",
"time" : "1248858348",
},
{
"downtime_author" : "admin",
"downtime_comment" : "Offline for repairs",
"downtime_end" : "1248860000",
"downtime_start" : "1248858348",
"eventid" : "9370",
"eventtype" : "2", # Downtime start event. Same for eventtype=3
"markdown" : "0",
"objectid" : "194",
"output" : "OK - load average: 1.53, 1.73, 1.58",
"servicename" : "Check Loadavg",
"state" : "ok",
"state_type" : "hard",
"time" : "1248858348",
},
...
],
"summary" : {
"entries" : "10",
"filtered_maxeventid" : "9373",
"filtered_new_event_count" : "2",
"maxeventid" : "9373",
"page" : "1",
"pages" : "85",
"total_entries" : "843"
}
}
The time, downtime_start and downtime_end parameters are the number of seconds since epoch which by definition is in the UTC time zone.
Note
Some fields are conditional and will only be displayed if appropriate.
["Opsview On-Premises"]
["API", "Technical Reference"]