(mt):Get warnings

  • This page was last modified on February 17, 2011, at 14:16.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

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
timeStampThe time these stats were recorded.
serviceWarningA list of service warnings.

The fields for each Service Warning represent the following:

Field Description
hostThe hostname of the service with warnings.
serviceIdThe service id of the service with warnings.
warningA list of warnings for the service.

The fields for each warning represent the following:

Field Description
statThe service stat that is over a threshold.
statusThe name of the threshold reached. See Get warning thresholds.
valueThe recorded stat value that is over a threshold.
minThe start of the range for the current status type.
max The end of the range for the current status type.
percentWhether or not the value represents a percentage.
descriptionA description of the current status.
urlA URL to more information about the current status.