Get Site Status Report

Last modified on May 14, 2021

Get Site Status report data for all or the specified monitors.

The report-sitestatus operation is similar to the sitestatus Report API operation, but it has different parameters that allow you to get the Site Status report for certain monitors or monitor types, sub-account monitors, and filter out the report data. See the operation parameters for details.

Request URL

GET https://api.alertsite.com/api/v3/report-sitestatus[?parameters]

Authentication

The request must include the Authorization header containing a user’s access token:

Authorization: Bearer ACCESS_TOKEN

See Authentication for more information.

Parameters

Query parameters are optional, but can be used to filter the returned data.

monitors

The ID of the monitor to get or a comma-separated list of monitor IDs. If neither monitors nor monitor_groups are specified, all monitors are returned.

The monitors and monitor_groups parameters are not cumulative. This means that if you specify both parameters, the report will include only those monitors that belong to the specified monitor groups. If a monitor is in multiple monitor groups, it will be included in the report as many times as many groups it is in.

To learn where to find a monitor ID, see Monitor IDs.

monitor_groups

The ID of the monitor group to get or a comma-separated list of monitor group IDs. If neither monitors nor monitor_groups are specified, all monitors are returned.

Tip: To learn the monitor group ID, click  Compare on the AlertSite UXM Dashboard, switch to the Config tab, select the needed monitor group, and see the Id column.

type

The type of the monitors to get or a comma-separated list of monitor types. By default, all monitor types are included in the report.

Accepted values:

Value Monitor Type

api

SoapUI API monitor

dejaclick

Real-browser or mobile web monitor (DéjàClick)

email-imap

Email server (IMAP) monitor

email-pop

Email server (POP) monitor

email-round-trip

Round-trip email monitor

email-smtp

Email server (SMTP) monitor

ftp

FTP monitor

ftp-ssl

FTPS (FTP over SSL) monitor

name-server

DNS (Name Server) monitor

perfecto

Perfecto Mobile monitor

ping

Ping monitor

selenium

Selenium monitor

serveragent

ServerAgent

tcp

TCP monitor

transaction

transaction-ssl

website

Web URL monitor

website-api

API endpoint monitor

website-ssl

Web URL monitor for https:// URLs

website-ssl-api

API endpoint monitor for https:// endpoints

summarize

Boolean. If set to true, it returns one report per monitor. If set to false (the default value), it shows results per monitor locations and includes information about the locations. See below for details.

shownotes

Boolean. Includes the monitor note status: whether it exists and has been seen. See note_exists and note_seen for details. The default value is false.

onlyerrors

Boolean. If set to true, it shows monitors only in the error status. The default value is false.

Note: The onlyerrors and onlyok parameters are mutually exclusive.

onlyok

Boolean. If set to true, it shows monitors only in the OK status. The default value is false.

Note: The onlyerrors and onlyok parameters are mutually exclusive.

enabledonly

Boolean. It shows only enabled monitors. The default value is false.

showsubaccounts

Boolean. This parameter applies only to accounts with subaccounts. If set to true, it shows monitors of the master account, as well as monitors of all subaccounts. The default value is false.

sub_accounts

This parameter applies only to accounts with subaccounts. The IDs of subaccounts or a comma-separated list of subaccount IDs whose monitor data you want to get. Use this parameter together with the showsubaccounts parameter set to true.

If you use this parameter together with the monitor or monitor_groups parameters, this will return reports for the specified monitors or monitor groups that belong to the specified subaccount. Other monitors of the specified subaccounts will not be included in the report.

Tip: You can learn the sub-account ID under the  Select a view menu in the Subaccounts section. See Filters and Views for details.

select

String. A comma-separated list of report data fields to return in the response. The field names are case-sensitive. Unrecognized field names are ignored.

If this parameter is omitted, all fields are included. Note that select= with an empty value is not the same as an omitted parameter, and means no fields will be returned.

For more information, see Filter response fields.

Response body

On success, the operation returns HTTP status 200 and a JSON representation of the Site Status report.

{
  "metadata": {
    "__permissions": {
      "acl": 7
    },
    "resultset": {
      "count": 1,
      "limit": null,
      "offset": null
    }
  },
  "results": [
    {
      "device_name": "Amazon sign in",
      "device_type": "DejaClick",
      "dt_last_error": "2019-06-19 03:30:52",
      "dt_last_status": "2019-06-19 03:30:52",
      "info_msg": "Timeout interval reached waiting for an expected URL location change event. Replay stopped.",
      "last_status": "84",
      "last_status_desc": "Location change timeout",
      "monitor": "y",
      "monitor_browser_description": "Google Chrome",
      "monitor_interval": "5",
      "monitor_type": "dejaclick",
      "obj_cust": "35531",
      "obj_device": "623862",
      "obj_devlog": "7580165",
      "resptime_last": "1.3790650367736816"
    }
  ]
}

A response body may include the following fields:

Value Description

device_name

The monitor name.

device_type

The monitor type (see below).

dt_last_error

The date and time when the last error was detected.

dt_last_status

The date and time of the latest monitor run.

info_msg

Optional additional error data.

last_status

The AlertSite status code of the latest monitor run.

last_status_desc

A short description of the last AlertSite status code.

latitude

The geographical coordinates of the location.

location_name

The location name.

longitude

The geographical coordinates of the location.

monitor

  • y – Monitoring is enabled.

  • n – Monitoring is disabled.

monitor_browser_description

The browser that is used to access the website being monitored. The field is returned only for DéjàClick monitors. Possible values: Google Chrome, Mozilla Firefox, Internet Explorer.

monitor_group_descrip

A short description of the monitor group.

monitor_group_id

The monitor group ID.

monitor_interval

How often the monitor checks your website.

monitor_type

The monitor type (see below).

note_exists

Shows whether a monitor note exists for the monitor:

  • 0 – A monitor note does not exist.

  • 1 – A monitor note exists.

note_seen

Shows whether a monitor note has been seen:

  • 0 – A monitor note has not been seen.

  • 1 – A monitor note has been seen.

obj_cust

The customer ID without the leading C character. For example, 12345.

obj_device

The monitor ID.

obj_devlog

Reserved for internal use.

obj_location

The location ID or a comma-separated list of location IDs. See here for the IDs of public AlertSite locations.

resptime_last

The response time during the latest test.

Below are possible values of the device_type and monitor_type fields:

device_type monitor_type Description

SoapUI API

api

SoapUI API monitor

DejaClick

dejaclick

Real-browser or mobile web monitor (DéjàClick)

Email IMAP

email-imap

Email server (IMAP) monitor

Email POP

email-pop

Email server (POP) monitor

Email Roundtrip

email-round-trip

Round-trip email monitor

Email SMTP

email-smtp

Email server (SMTP) monitor

FTP Server

ftp

FTP monitor

Secure FTP Server

ftp-ssl

FTPS (FTP over SSL) monitor

Name Server

name-server

DNS (Name Server) monitor

Mobile Monitor

perfecto

Perfecto Mobile monitor

Ping

ping

Ping monitor

Selenium Script

selenium

Selenium monitor

ServerAgent

serveragent

ServerAgent

Simple TCP Connect

tcp

TCP monitor

Transaction

transaction

Secure Transaction

transaction-ssl

Web Site

website

Web URL monitor

Web Site API

website-api

API endpoint monitor

Secure Web Site

website-ssl

Web URL monitor for https:// URLs

Secure Web Site API

website-ssl-api

API endpoint monitor for https:// endpoints

Error responses have a non-200 status and include the errors list:

{
    "errors": [
        {
            "code": 400,
            "message": "Invalid type filter provided: website-monitor"
        }
    ]
}

Try it out

Click here to test this operation in the AlertSite interactive API console.

Code examples

cURL

Get the Site Status report for all monitors:

curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus' -H 'Authorization: Bearer ACCESS_TOKEN'

Get the Site Status report for monitor ID 150610 and 149098:

curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?monitors=150610,C149098' -H 'Authorization: Bearer ACCESS_TOKEN'

Get the Site Status report for SoapUI and API endpoint monitors:

curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?type=api,website-api' -H 'Authorization: Bearer ACCESS_TOKEN'

Get the Site Status report for all monitors in error:

curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?onlyerrors=true' -H 'Authorization: Bearer ACCESS_TOKEN'

Get the Site Status report for all monitors but include only the monitor name and type, last run status and its description, and the last response time:

curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?select=device_name,monitor_type,last_status,last_status_desc,resptime_last' -H 'Authorization: Bearer ACCESS_TOKEN'

Python

Python

import requests  # Requests library – http://docs.python-requests.org/
import pandas    # Pandas library – https://pandas.pydata.org/
import json

baseUrl = 'https://api.alertsite.com/api/v3'
username = 'demo@example.com' # Replace with your AlertSite login email
password = 'pa55w0rd'         # Replace with your AlertSite password

# Log in
payload = {'username': username, 'password': password}
r = requests.post(baseUrl + '/access-tokens', data=json.dumps(payload), headers={'Content-Type': 'application/json'})
token = r.json()['access_token']
r = requests.get(baseUrl + '/report-sitestatus', headers={'Authorization': 'Bearer ' + token})
result = r.json()

if r.status_code == requests.codes.ok:
    # Use Pandas to output the report as a table
    data_frame = pandas.DataFrame(result['results'], columns=['obj_device', 'device_name', 'dt_last_status', 'last_status', 'resptime_last'])

    # Truncate monitor names and response time to fit the display
    data_frame['device_name'] = data_frame['device_name'].str[:20]
    data_frame['resptime_last'] = data_frame['resptime_last'].str[:6]

    with pandas.option_context('display.max_rows', None, 'display.max_columns', None, 'display.width', 120):
        print(data_frame)
else:
    print('Could not get the Site Status report. The following error(s) occurred:', *result['errors'], sep='\n')

See Also

AlertSite Management API
AlertSite Management API Reference

Highlight search results