MeanPing API Alerts Usage

MeanPing, our website monitoring tool, allows you to build custom web applications by connecting to the MeanPing API. Please note, that we cannot provide free support for those wishing to make their own script to link to the MeanPing API. This information is provided as-is with no warranty. If you believe there is a problem with the MeanPing API, you are more than welcome to contact us regarding the error you believe you may have found.

A WebHook API alert will send a request to a URL on your server containing one post variable called webhook_data. The webhook_data field contains a json string with the following data:

results: will be true if this is a recovery alert and will be false if this is a down alert.
key: The key you enter below used to authenticate the hook request.
alert_date_time: The time the alert was sent.
downtime: The total downtime of this alert.
check_name: The name of the check.
hostname: The hostname/url of the check.
check_type: The type of check being performed.
check_notes: User entered check notes.
failure_message: User entered custom failure message, this is only sent on a failure.
recover_message: User entered custom recovery message, this is only sent on recovery.
first_down_time: When the first down alert was sent.
location: The location of the check failure, this is only sent on failure not on recovery.
error_message: The error message from the check, this is only sent on failure.
dns_hostname: The dns hostname being checked, only sent for the alert type of DNS.
dns_record_type: The record type of the DNS check, only sent for the alert type of DNS.
dns_server: The dns server being used to perform the check, only sent for the alert type of DNS.

The following is a simple web hook that checks the key that was passed and prints the downtime. This wouldn't actually do anything, this is just an example to get you started.

<?php

$results = json_decode($_POST['webhook_data']);

if ($results->key == "mysecretkey") {

echo $results->downtime;

}

?>
  • 40379 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

How do I downgrade/upgrade my VPS plan?

If you would like to upgrade or downgrade your service, please follow this procedure: Login to...

Updating Account Information

To help combat fraud, Mean Servers has disabled the following fields in your client area:...

How to remove your IP address from cPanel firewall

If you can no longer access your website or the cPanel control panel and our status page shows...

Support Requests for Unmanaged Plans

In order to keep our prices low, Mean Servers has adopted the following policy that is in force...

rDNS Requests

Mean Servers supports automated IPv4 and IPv6 rDNS requests for virtual private server customers...