Introduction:
Utilize the 360 Monitoring API to incorporate metrics into a server. This functionality enables you to post statistics to our API directly from within your applications, such as error counts, offering enhanced flexibility and customization for monitoring your server's performance.

Approximately 1 Hour Process
CURL with PHP
The following example code demonstrates how to add metrics with PHP via CURL:
<?php
$timestamp = time();
$api_token = '3318e3223ac57e7aa5269a4aaf1abc1a2';
$server_id = '5aafddba3a2bbd3ae5230aa30';
// Creating 5 data points of the last 5 minutes.
$data_points[] = array($timestamp, 45);
$data_points[] = array($timestamp-60, 42);
$data_points[] = array($timestamp-120, 49);
$data_points[] = array($timestamp-180, 55);
$data_points[] = array($timestamp-240, 95);
$payload['metrics'][] = array("metric" => "motherboard.temp", "points" => $data_points);
//Submit several metric sets at once...
//$payload['metrics'][] = array("metric" => "motherboard.fanspeed", "points" => $data_points);
$ch = curl_init('https://api.eu.monitoring.platform360.io/v1/server/'.$server_id.'/store?token='.$api_token);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen(json_encode($payload)))
);
$result = curl_exec($ch);
echo $result;
?>
CURL via command line
The following example code demonstrates how to add metrics via CURL on the command line:
curl -X POST -H "Content-type: application/json" -d "{ \"metrics\" :[{\"metric\":\"motherboard.temp\",\"points\":[[1523439139, 20],[1523439339, 40],[1523439539, 70]]}]}" https://api.eu.monitoring.platform360.io/v1/server/5aafddba3a2bbd3ae5230aa30/store?token=3318e3223ac57e7aa5269a4aaf1abc1a2
Require additional assistance?
Our dedicated Australian support team is ready to help. Reach out to us via email at [email protected] or by submitting a support ticket through your Zeniar Portal.