HTTP POST alerts
Monitive is able to execute a HTTP POST to an URL that you specify in case of a down or up alert. To do this, edit your monitor and click Add new URL under URL POST alerts. Type the URL to send the POST to (including http) and click Save.
In the event of an outage, Monitive will send a POST call to the specified URL(s), sending the following attributes:
- service – the monitor’s name
- type– monitor type (such as http)
- date_time – when did the event occur, in YYYY-MM-DD HH:MM:SS format (users’s timezone)
- action – UP or DOWN
- diagnosis – the URL for the diagnosis report (only available after 2 minutes of downtime)
For example, if we’re using PHP to handle the POST alerts, a simple script to handle POST alerts would be:
<?php file_put_contents("/tmp/http-post.txt", print_r($_POST,1) ); ?>
This, when an outage occurs, would write in the file /tmp/http-post.txt the following output:
Array ( [service] => CertifiedVision.com [type] => http [date_time] => 2013-05-01 08:45:04 [action] => DOWN [diagnosis] => https://admin.monitive.com/alert/diagnostics/5MzUzLTI0MTk3 )
in case of an outage, and on recovery:
Array ( [service] => CertifiedVision.com [type] => http [date_time] => 2013-05-01 08:49:20 [action] => UP [diagnosis] => https://admin.monitive.com/alert/diagnostics/5MzUzLTI0MTk3 )
This way, you can implement custom actions to handle the outage situations.
UPDATE 4-June-2013: added the diagnosis parameter when executing the HTTP POST request.