Documentation

API Reference :: results

GET

Get check results

  • customerid - optional - customerid of the subaccount you want to get results for. You can omit this if getting results for a check in your primary account.
  • id - required - Check id of the check you want to get.
  • span - optional integer - number of hours of results to retrieve. If used in combination with limit the narrower range will be used.
  • limit - optional integer - number of records to retrieve. Defaults to 300 if span is not set. Maximum is 43201. If used in combination with span the narrower range will be used. If limit = 1 clean is assumed to be set to true.
  • start - optional - date/time for the start of the results. Timestamps should be milliseconds, or an RFC2822 or ISO 8601 date like YYYY-MM-DD HH:MM:SS. Times are assumed to be GMT unless the time includes the time zone (as in GMT-0400).
  • end - optional - date/time for the end of the results. This works the same as start, and is intended to be used in conjunction with that parameter. start and end cannot be used with span, but do combine with limit. Flipping end and start will flip the sort order of the results.
  • clean - optional - boolean sets whether to use the older format for the result record that includes a doc object. We strongly recommend that you set this to true, as the older format will be deprecated in the future. Currently defaults to false, unless limit=1, but in future versions of the api the default will change to true.

Request example:

curl -X GET https://api.nodeping.com/api/1/results/201205050153W2Q4C-0J2HSIRF

The response example shown here is using the "clean" parameter. If "clean" is false the following results will be inside a "doc" object. Response example:

[{
  "_id":"201205050153W2Q4C-0J2HSIRF-1345313038648",
  "ci":"201205050153W2Q4C",
  "t":"DNS",
  "tg":"8.8.8.8",
  "th":"5",
  "i":"5",
  "ra":"1345313029252",
  "q":"caRRa3op0v",
  "s":1345313038648,
  "sc":"Success",
  "su":true,
  "rt":77,
  "e":1345313038725,
  "l":{"1345313038648":"ca"}
}

Results fields:

  • _id - ID of the result record.
  • ci - customer id
  • t - Check Type: DNS, FTP, HTTP, HTTPCONTENT, IMAP4, MYSQL, PING, POP3, PORT, RDP, SMTP, SSH, SSL
  • tg - Target, generally the URL or Hostname
  • th - Threshold or timeout for this check
  • i - Check interval
  • ra - Timestamp, when this check was scheduled to run
  • q - Internal informationa about what queue this check was in when it ran.
  • s - Timestamp, when this check actually ran. This will usually be a few ms behind ra
  • sc - Short text field showing the result of the check. This varies slighly by check type. For HTTP checks, it is the status code returned by the remote server.
  • m - Message regarding the result of the check. This varies by check type, but generally if there is an error code it will appear in this field.
  • su - boolean, whether the check was a pass or fail
  • rt - The run time. This is the value that get's charted. For many checks this is the value of e - s.
  • e - Timestamp, when the check finished.
  • l - list of locations the check ran in, and the timestamps for each.

UPTIME

Retrieves uptime information for a check.

  • customerid - optional - customerid of the subaccount you want to get results for. You can omit this if getting results for a check in your primary account.
  • id - required - Check id of the check you want to get.
  • interval - optional - "days" or "months", "months" is the default.
  • start - optional - start date for the range of days or months. If absent, starts at beginning of available data.
  • end - optional - end date for the range of days or months (excluded - meaning 'up to this date but not including'). If absent, end date is "now"

Request example:

curl -X GET https://api.nodeping.com/api/1/results/uptime/201205050153W2Q4C-0J2HSIRF

The Response includes the following fields for each time period in the range requested, plus a total that sums these fields:

  • enabled - the number of milliseconds that the check was enabled in the time period
  • down - the number of milleseconds the check was marked as "down" in the time period
  • uptime - the percent uptime for the time period. This is calculated based on the time that the check is enabled, so if a check is disabled for a while it does not count against uptime.

Response example:

{
    "2012-10": {
            "enabled": 2678400000,
            "down": 35210534,
            "uptime": 98.685
    },
    "2012-11": {
            "enabled": 585947750,
            "down": 248109,
            "uptime": 99.958
    },
    "total": {
            "enabled": 3264347750,
            "down": 35458643,
            "uptime": 98.914
    }
}

CURRENT

Retrieves information about current "events" for checks. Events include down events and disabled checks. If you need a list of all checks with their passing/failing state, please use the 'checks' list rather than this 'current' call.

  • customerid - optional - customerid of the subaccount you want to get results for. You can omit this if getting results for a check in your primary account.

Request example:

curl -X GET https://api.nodeping.com/api/1/results/current

The Response includes the following fields:

  • type - disabled or down
  • label - the check's label
  • t - timestamp when the event began

If you have any questions, get in touch at support@nodeping.com, or use our Contact form.