In order to receive Server Monitoring Resource Usage webhook notifications, you will need to have the following:
- An Uptime Monitor which has a contact list with Webhooks enabled:
– http://docs.hetrixtools.com/uptime-monitoring-webhook-notifications/ - Attach a Server Monitor to this Uptime Monitor, and install the Server Agent on your VPS or Dedicated Server:
– https://docs.hetrixtools.com/install-the-hetrixtools-server-monitor-agent/ - Configure resource usage warnings for this Server Monitor:
– https://docs.hetrixtools.com/set-resource-usage-warnings/
Once you’ve got all of that configured, whenever you receive Resource Usage alerts, your Webhook URL will receive JSON format data, as well.
Here’s an example of a CPU Usage warning Webhook notification:
{ "monitor_id":"ThisWillBeTheMonitorID32CharLong", "monitor_name":"Test Monitor Label", "timestamp":1499666613, "resource_usage":{ "resource_type":"cpu", "current_usage":"24.60", "average_usage":"25.29", "average_minutes":"3" } }
Understanding the parameters:
monitor_id – your monitor’s unique ID (can be found in the link of your monitor’s uptime report);
monitor_name – the label of your uptime monitor;
timestamp – is the unix time stamp at which the event occurred;
resource_type – describes which resource type this notification is about (can be: cpu, ram, disk, network_inbound, network_outbound);
current_usage – the current usage (percent) for this server monitor (i.e.: the usage taken the same minute the notification is sent out);
average_usage – the average usage (percent) over average_minutes minutes (based on your resource usage warning configuration).