Status¶
Events¶
webprefix: | /v2/status/events/ |
---|
Hosts¶
-
POST
/v2/status/hosts
¶ Given a LiveQuery, returns all matching hosts. :type query:
LiveQuery
Return type: list( LiveHost
)
-
GET
/v2/status/hosts/
(host_name)/config
¶ Returns config from a specific host.
-
POST
/v2/status/hosts/
(host_name)/results
¶ Submit a new check result.
Parameters: - data (
CheckResult
) – a check result within the request body.
- data (
-
GET
/v2/status/hosts/
(host_name)/metrics
¶ Returns all metrics name for a host.
Return type: list( Metric
)
-
GET
/v2/status/hosts/
(host_name)/metrics/
(metric_name)¶ Return the last measure for the metric name on the host.
Return type: Metric
-
POST
/v2/status/hosts/
(host_name)/metrics/
(metric_name)¶ Given a live query, returns all matching metrics.
Parameters: - live_query – a live query within the request body.
Return type: list(
Metric
)
-
POST
/v2/status/hosts/
(host_name)/services/
(service_description)/results
¶ Submit a new check result.
Parameters: - data (
CheckResult
) – a check result within the request body.
- data (
Services¶
-
GET
/v2/status/services
¶ Returns all services.
Return type: list( LiveService
)
-
POST
/v2/status/services
¶ Given a LiveQuery, returns all matching services. :type query:
LiveQuery
Return type: list( LiveService
)
types documentation¶
-
type
LiveService
¶ Data samples:
- Json
{ "acknowledged": true, "description": "Serves Stuff", "host_name": "Webserver", "last_check": 1429220785, "last_state_change": 1429220785.481679, "long_output": "Serves /var/www/\nServes /home/webserver/www/", "plugin_output": "HTTP OK - GOT NICE RESPONSE", "service_description": "Apache", "state": "OK" }
- XML
<value> <host_name>Webserver</host_name> <service_description>Apache</service_description> <description>Serves Stuff</description> <state>OK</state> <acknowledged>true</acknowledged> <last_check>1429220785</last_check> <last_state_change>1429220785.48</last_state_change> <plugin_output>HTTP OK - GOT NICE RESPONSE</plugin_output> <long_output>Serves /var/www/ Serves /home/webserver/www/</long_output> </value>
-
acknowledged
¶ Type: bool Wether or not the problem, if any, has been acknowledged
-
description
¶ Type: unicode The description of the sevice
-
host_name
¶ Type: unicode The host for the service
-
last_check
¶ Type: int The last time the service was checked
-
last_state_change
¶ Type: float The last time the state has changed
-
long_output
¶ Type: unicode Plugin long output of the last check
-
plugin_output
¶ Type: unicode Plugin output of the last check
-
service_description
¶ Type: unicode The name of the service
-
state
¶ Type: unicode The current state of the service
-
type
LiveHost
¶ Data samples:
- Json
{ "acknowledged": true, "address": "127.0.0.1", "childs": [ "surveil.com" ], "description": "Very Nice Host", "host_name": "CoolHost", "last_check": 1429220785, "last_state_change": 1429220785, "long_output": "The ping was great\nI love epic ping-pong games", "parents": [ "parent.com" ], "plugin_output": "PING OK - Packet loss = 0%, RTA = 0.02 ms", "services": [ "load", "cpu", "disk_usage" ], "state": "OK" }
- XML
<value> <host_name>CoolHost</host_name> <address>127.0.0.1</address> <childs> <item>surveil.com</item> </childs> <parents> <item>parent.com</item> </parents> <description>Very Nice Host</description> <state>OK</state> <acknowledged>true</acknowledged> <last_check>1429220785</last_check> <last_state_change>1429220785</last_state_change> <plugin_output>PING OK - Packet loss = 0%, RTA = 0.02 ms</plugin_output> <long_output>The ping was great I love epic ping-pong games</long_output> <services> <item>load</item> <item>cpu</item> <item>disk_usage</item> </services> </value>
-
acknowledged
¶ Type: bool Wether or not the problem, if any, has been acknowledged
-
address
¶ Type: unicode The address of the host
-
childs
¶ Type: list(unicode) The childs of the host
-
description
¶ Type: unicode The description of the host
-
host_name
¶ Type: unicode The name of the host
-
last_check
¶ Type: int The last time the host was checked
-
last_state_change
¶ Type: int The last time the state has changed
-
long_output
¶ Type: unicode Plugin long output of the last check
-
parents
¶ Type: list(unicode) The parents of the host
-
plugin_output
¶ Type: unicode Plugin output of the last check
-
services
¶ Type: list(unicode) The services of the host
-
state
¶ Type: unicode The current state of the host
-
type
Metric
¶ Data samples:
- Json
{ "critical": "100", "max": "100", "metric_name": "pl", "min": "0", "unit": "s", "value": "0", "warning": "100" }
- XML
<value> <metric_name>pl</metric_name> <max>100</max> <min>0</min> <critical>100</critical> <warning>100</warning> <value>0</value> <unit>s</unit> </value>
-
critical
¶ Type: unicode Critical value for the metric
-
max
¶ Type: unicode Maximum value for the metric
-
metric_name
¶ Type: unicode Name of the metric
-
min
¶ Type: unicode Minimal value for the metric
-
unit
¶ Type: unicode Unit of the metric
-
value
¶ Type: unicode Current value of the metric
-
warning
¶ Type: unicode Warning value for the metric
-
type
TimeInterval
¶ Hold a time.
Data samples:
- Json
{ "end_time": "2015-01-29T22:50:44Z", "start_time": "2015-01-29T21:50:44Z" }
- XML
<value> <start_time>2015-01-29T21:50:44Z</start_time> <end_time>2015-01-29T22:50:44Z</end_time> </value>
-
end_time
¶ Type: unicode The ending time.
-
start_time
¶ Type: unicode The starting time.
-
type
Event
¶ Data samples:
- Json
{ "alert_type": "SERVICE", "attempts": 4, "event_type": "ALERT", "host_name": "CoolHost", "notification_method": "notify-service-by-email", "notification_type": "", "output": "WARNING - load average: 5.04, 4.67, 5.04", "service_description": "Apache Service", "state": "CRITICAL", "state_type": "HARD", "time": "2015-06-04T18:55:12Z" }
- XML
<value> <time>2015-06-04T18:55:12Z</time> <event_type>ALERT</event_type> <host_name>CoolHost</host_name> <service_description>Apache Service</service_description> <state>CRITICAL</state> <state_type>HARD</state_type> <attempts>4</attempts> <notification_type /> <notification_method>notify-service-by-email</notification_method> <alert_type>SERVICE</alert_type> <output>WARNING - load average: 5.04, 4.67, 5.04</output> </value>
-
alert_type
¶ Type: unicode Type of alert. This is only HOST or SERVICE
-
attempts
¶ Type: int Number of attempts to confirm state
-
downtime_type
¶ Type: unicode Type of alert. This is only HOST or SERVICE
-
event_type
¶ Type: unicode Type of event. This is only ALERT
-
host_name
¶ Type: unicode Host which the alert is from.
-
output
¶ Type: unicode Additional output of the alert.
-
service_description
¶ Type: unicode Service which raised the alert
-
state
¶ Type: unicode State of the service or host who raised the alert
-
state_type
¶ Type: unicode Confirmness level of the state [SOFT|HARD]
-
time
¶ Type: unicode Timestamp of the alert