(mt):Get warnings
- This page was last modified on February 17, 2011, at 14:16.
From (mt) Community Wiki
Contents |
This method provides a way to retrieve current warnings for all services associated with the authenticated account. This method only provides warnings that are currently in progress (e.g. it will not return all warnings for exceeded thresholds over the past hour).
Request Info
The following URL and HTTP method should be used:
| HTTP Method | URL |
|---|---|
| GET | https://api.mediatemple.net/api/v1/stats/warnings |
Response Info
The response will return an HTTP status code to indicate the general category of success or failure to the client. More specific error codes and messages will be contained in the response data itself, if provided. For more information on response codes and parsing response data, see Parsing API responses.
Sample Request
To get the warnings for the authenticated account in JSON format, do the following:
curl -D log.txt -s -X "GET" "https://api.mediatemple.net/api/v1/stats/warnings.json?apikey=a5h34sf62..."
Sample Response
Here is an example of the returned result:
{
"multipleServiceWarnings" : {
"timeStamp" : 1284599245,
"serviceWarning" : [ {
"host" : "vzd000.mediatemple.net",
"serviceId" : 555,
"warning" : [ {
"stat" : "load1Min",
"status" : "Warning",
"value" : 16.0,
"min" : 15,
"max" : 24,
"percent" : false,
"description" : "This is an uhealthy server",
"url" : "http://www.google.com/search?q=warning"
}, {
"stat" : "load5Min",
"status" : "Warning",
"value" : 24.0,
"min" : 15,
"max" : 24,
"percent" : false,
"description" : "This is an uhealthy server",
"url" : "http://www.google.com/search?q=warning"
}, {
"stat" : "load15Min",
"status" : "Critical",
"value" : 31.99,
"min" : 25,
"max" : null,
"percent" : false,
"description" : "This server is in critical condition",
"url" : "http://www.google.com/search?q=critical"
} ]
} ]
}
}
The response above contains 3 warnings for a single service: load1Min (warning), load5Min (warning) and load15Min (critical). To get a list of the thresholds used to determine if a service has warnings, see Get warning thresholds. Note that only non-healthy (Warning, Critical, Offline) thresholds will be returned.
Response Fields
The fields in the result represent the following:
| Field | Description |
|---|---|
| timeStamp | The time these stats were recorded. |
| serviceWarning | A list of service warnings. |
The fields for each Service Warning represent the following:
| Field | Description |
|---|---|
| host | The hostname of the service with warnings. |
| serviceId | The service id of the service with warnings. |
| warning | A list of warnings for the service. |
The fields for each warning represent the following:
| Field | Description |
|---|---|
| stat | The service stat that is over a threshold. |
| status | The name of the threshold reached. See Get warning thresholds. |
| value | The recorded stat value that is over a threshold. |
| min | The start of the range for the current status type. |
| max | The end of the range for the current status type. |
| percent | Whether or not the value represents a percentage. |
| description | A description of the current status. |
| url | A URL to more information about the current status. |