×
Status - Service List
Request URL: /rest/status/service
GET
— lists information about services.PUT
,POST
,DELETE
— unimplemented.
The URL parameters includes the service object filtering parameters. These are also available:
downtime_start_time
anddowntime_comment
— filter based on downtime that matches these conditions.filter
— eitherhandled
orunhandled
. Filters services by this condition.host_filter
— eitherhandled
orunhandled
. Filters host by this condition.state
— filters by services in this state. Expects the numeric ID for state. Can be repeated.state_type
— filters by service state type. Expects either0
(soft) or1
(hard). Defaults to both.host_state
— numeric state value. The value can be repeated. Ifincludehosts=0
(default), then the host state of each service must be in this state (AND condition). Ifincludehosts=1
, then either services are in the chosen state, or any host are in this chosen state (OR condition).host_state_type
— filters by host state type. Expects either0
(soft) or1
(hard). Defaults to both.includeperfdata
— if set, will add data about the performance metrics for services that have performance information.convertuom
— if set, this will convert performance data into base units. For example, ifvalue=1500
anduom=MB
, with this flag set, this will returnvalue=1500000000
anduom=bytes
.includehandleddetails
— if set, will include acknowledgement information.includehosts
— default value is0
. If set, this will change the ordering by state to the order below. Also, it will change the filter tounhandled
orhandled
to include hosts specifically. Whenincludehosts
is set, each host could have services = [], which means this is a host only object. This parameter can change the definition ofhost_state
.type
— only applicable whenincludehosts=1
. Set to eitherhost
orservice
. If not set, will assume both. If set more than once, the first value is used.rows
— returns this number of rows. Set toall
to get all results. Defaults toall
.page
— returns this page number if rows is set to a number. Defaults to first page.include_allrows
— if set and page is set, this will returnsummary.allrows
which will be the total number of rows based on the filtering parameters. Defaultno
.recheck=1
— response will filter only the objects that can be rechecked. Default is0
.order
— can order the results. The value can be repeated. Valid values (you can suffix with_desc
to order descending):state
— orders by service state. - Ifincludehosts=0
, host states have priority (DOWN
,UNREACHABLE
,UP
,CRITICAL
,WARNING
,UNKOWN
, andOK
). - Ifincludehosts=1
, then states are intermingled by priority (DOWN
,CRITICAL
,WARNING
,UNREACHABLE
,UNKNOWN
,UP
, andOK
)service
— orders by service name.host
— orders by host name.host_state
— orders by host state.ip
— orders by network address.alias
— orders by host description.hostgroup
— orders by host group name.last_check
— orders by last check time.last_state_change
— orders by last state change time.state_duration
— orders by most recent state changes first.
Example output Copied
Note
The host portion could have two additional keys regarding Monitoring Collector and/or Cluster health. See Host Summary for more details.
{
"list" : [
{
"alias" : "Opsview Master Server", // Host description
"comments" : "1",
"current_check_attempt" : "0",
"downtime" : "0",
"hostgroup" : "US Data Centre", // Host group for the host
"icon" : "opsview",
"ip" : "10.10.10.10", // Network address for the host
"last_check" : "1970-01-01 00:00:00",
"max_check_attempts" : "0",
"name" : "opsview",
"num_interfaces" : "0",
"num_services" : "6",
"output" : "Dummy output",
"services" : [
{
"current_check_attempt" : "1",
"downtime" : "0",
"last_check" : "2011-01-16 22:51:29",
"markdown" : "0",
"max_check_attempts" : "3",
"name" : "Collector-node: opcollector",
"output" : "collector-node check with fake results",
"perfdata_available" : "1",
"service_object_id" : "219",
"state" : "ok",
"state_type" : "hard",
"state_duration" : "9296782",
"unhandled" : "0"
},
{
"current_check_attempt" : "1",
"downtime" : "0",
"last_check" : "2011-01-16 22:52:34",
"markdown" : "0",
"max_check_attempts" : "3",
"name" : "Collector-node: opcollectorclusterA",
"output" : "collector-node opcollectorclusterA check with fake results",
"perfdata_available" : "1",
"service_object_id" : "220",
"state" : "critical",
"state_type" : "soft",
"state_duration" : "9296717",
"unhandled" : "1"
}
],
"state" : "up",
"state_type" : "hard",
"state_duration" : "1304515071",
"summary" : {
"critical" : "1",
"handled" : "1",
"computed_state" : "critical",
"ok" : "1",
"total" : "2",
"unhandled" : "1"
},
"unhandled" : "0"
}
],
"summary" : {
"handled" : "2",
"host" : {
"handled" : "1",
"total" : "1",
"unhandled" : "0",
"up" : "1"
},
"service" : {
"critical" : "1",
"handled" : "1",
"ok" : "1",
"total" : "2",
"unhandled" : "1"
},
"total" : "3",
"unhandled" : "1"
}
}
The following attributes will only be returned if true for a host or service. If the attribute does not exist, you can assume that the values are 0:
acknowledged
— 1.flapping
— 1.
Note
The format of the last_check field has changed to being epoch seconds. To have the old behaviour, use the URL parameter offormat_datetime=1
.
["Opsview On-premises"]
["API", "Technical Reference"]