Webhook Integration
Webhooks are a simple and powerful way to send real-time notifications from Xitoring to your application. With webhook integration, you can receive alerts and incidents as they happen, enabling you to take immediate action and minimize downtime.
To set up webhook integration in Xitoring, follow these steps:
Create a Webhook URL
The first step is to create a webhook URL in your server or application. This is the URL where Xitoring will send the webhook notifications. Make sure the URL is publicly accessible and can receive HTTP POST requests.
Configure Webhook in Xitoring
Once you have a webhook URL, log in to your Xitoring account and go to the Notification Roles
page. Click on the Notification role you want to add Webhook to it (or create a new notification role), and from the bottom of the page enter your Webhook URL in the field and then click on Send a Test Notification
to get a test incident and make sure you have set up everything right.
Example request from Xitoring
The following is a full example of what Xitoring will POST to your Webhook URL:
As curl
curl -X 'POST' 'https://yourwebhook.app/cb92459602ccc67a8f7b' -H 'connection: close' -H 'content-type: application/x-www-form-urlencoded' -H 'content-length: 163' -H 'accept: */*' -H 'host: yourwebhook.app' -d #39;id=0&group=test+group&sub_group=test+subgroup&server_id=0&check_id=0&label=server+label&name=&type=20&type_human_readable=ping&unit=&value=&status=0&incident_time='
Raw
id=0&group=test+group&sub_group=test+subgroup&server_id=0&check_id=0&label=server+label&name=&type=20&type_human_readable=ping&unit=&value=&status=0&incident_time=
Request breakdown
The following table is a guide to make it easy to integrate Xitoring webhook feature to your application.
Variable | Type | Example | Explanation |
---|---|---|---|
id | integer | 0 | The incident ID |
group | string | "test group" | Name of the Group that check or server is assigned to |
sub_group | string | "test sub-group" | Name of the Sub-group that check or server is assigned to |
server_id | integer | 1 | ID of the server |
check_id | integer | 1 | ID of the Check |
label | string | "test server" | Server or Check label |
name | string | "total" | Trigger name. e.g. total, used, keys |
type | integer | 20 | According to the type list below this table |
type_human_readable | string | "ping" | ping, http, dns, ftp, ... |
unit | string | "mb" | some incident have units like MB or GB, mostly metric values |
value | sting | "" | mostly metric incidents has values e.g. memory usage in time of incident |
status | integer | 0 | 0 is down and 1 is up |
message | string | "" | The body of the message client gets |
incident_time | integer | "" | time of the incident |
Type mapping and definition
Type | ID |
---|---|
Ping | 20 |
HTTP(s) | 21 |
DNS | 22 |
FTP | 23 |
SMTP | 24 |
POP3 | 25 |
IMAP | 26 |
Heartbeat | 30 |
Load average | 1 |
CPU usage | 2 |
Memory usage | 3 |
Disk usage | 4 |
Disk I/O | 5 |
Network | 6 |
Nginx | 111 |
Apache | 112 |
FPM | 113 |
Redis | 114 |
KeyDB | 115 |
Supervisor | 116 |
Docker | 117 |
MySQL | 118 |
MongoDB | 119 |
HAProxy | 120 |