Check monitoring

Posting monitoring check reports

This will transmit a monitoring check’s report to Mackerel. Monitoring reports are restricted to hosts.

POST /api/v0/monitoring/checks/report

Implementation described in Adding a monitoring check item by script is being used.The agent will periodically transmit the list of configured monitoring checks to the Updating host information API and, any monitoring checks that aren’t included in that list will be deleted from Mackerel at that time. If a new monitoring timestamp has already been posted with the same name/host, posting will be ignored.

Required permissions for API key

  • Read
  • Write

Input

{
  "reports": [ <report>, <report>, … ]
}

<report> : an object that holds the following keys. Up to 100 <report> can be sent with one API request.

KEY TYPE DESCRIPTION
source source refer to the
name string monitor name
status string monitor report status. "OK", "CRITICAL", "WARNING", or "UNKNOWN"
message string auxiliary text attached to a monitor report status, under 1024 characters
occurredAt number unix timestamp of execution
notificationInterval number [optional] Notifications will not be re-sent if the time interval (in minutes) is omitted. If the time interval is set for less than 10 minutes, the notifications will be re-sent at an interval of 10 minutes.
maxCheckAttempts number [optional] number of consecutive Warning/Critical instances before an alert is made. Default setting is 1 (1-10)

source : an object that holds the following keys

KEY TYPE DESCRIPTION
type string fixed number character string "host"
hostId string host ID (given by the server when the host was registered)

Response

Success

{
  "success": true
}

Error

STATUS CODE DESCRIPTION
403 when the API doesn't have the required permissions / when accessing from outside the permitted IP address range
other than 200 any error other than the above