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 for which you want to get the results.
  • 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 information 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 slightly 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"
  • offset - optional - the records are stored using UTC times. Specify an integer offset to have the system perform uptime calculations for a different time zone. Supports integer values for hours (-24 to 24), minutes (-1441 to 1441), seconds (-86401 to 86401), or ms (-8640100 to 8640100), up to 24 hours. Only integers are supported, so if you need to specify the offset in portions of hours, use minutes or smaller units. Note that this is a numeric offset, and is not aware of daylight savings.

Request examples:

curl -X GET https://api.nodeping.com/api/1/results/uptime/201205050153W2Q4C-0J2HSIRF
The example below will get the uptime for each day between 2020-06-01 and now, offset by negative eight hours (which is equivalent to PST).
curl -X GET https://api.nodeping.com/api/1/results/uptime/201205050153W2Q4C-0J2HSIRF?start=2020-06-01&interval=days&offset=-8

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 milliseconds 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
    }
}

EVENTS

Retrieves information about "events" for checks. Events include down events and disabled checks.

  • 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, but it is required to retrieve records for subaccounts.
  • id - required - ID of the check for which you are retrieving events.
  • start - optional - Start date to retrieve events from a specific range of time.
  • end - optional - End date to retrieve events from a specific range of time.
  • limit - optional - limit for the number of records to retrieve. Since the records are sorted by the start time of the event in descending order, setting this to 1 will retrieve the most recent event.

Request example:

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

Response example:

{
   "201205050153W2Q4C-0J2HSIRF":
       [
            {
                "start" : 1598888154610,
                "end" : 1598888363766,
                "message" : "HTTP status returned: 500",
                "open" : false,
                "type" : "down"
            },
            {
                "start" : 1588711161563,
                "end" : 1588711310072,
                "message" : "HTTP status returned: 500",
                "open" : false,
                "type" : "down"
            }
        ]
}

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

SUMMARY

Retrieves hourly summary information about the results for a specific 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.

Request example:

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

The Response includes the following fields:

  • hour - UTC hour for the summary data. example: 2023-03-20 20
  • cnt - number of results recorded for that hour
  • max - highest recorded result (usually runtime)
  • min - lowest recorded result (usually runtime)
  • avg - average of all results for the hour

If you have any questions, get in touch at [email protected], or use our Contact form.