Webhook Integration | Xitoring Document

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='
1

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=
1

Request breakdown

The following table is a guide to make it easy to integrate Xitoring webhook feature to your application.

VariableTypeExampleExplanation
idinteger0The incident ID
groupstring"test group"Name of the Group that check or server is assigned to
sub_groupstring"test sub-group"Name of the Sub-group that check or server is assigned to
server_idinteger1ID of the server
check_idinteger1ID of the Check
labelstring"test server"Server or Check label
namestring"total"Trigger name. e.g. total, used, keys
typeinteger20According to the type list below this table
type_human_readablestring"ping"ping, http, dns, ftp, ...
unitstring"mb"some incident have units like MB or GB, mostly metric values
valuesting""mostly metric incidents has values e.g. memory usage in time of incident
statusinteger00 is down and 1 is up
messagestring""The body of the message client gets
incident_timeinteger""time of the incident
Type mapping and definition
TypeID
Ping20
HTTP(s)21
DNS22
FTP23
SMTP24
POP325
IMAP26
Heartbeat30
Load average1
CPU usage2
Memory usage3
Disk usage4
Disk I/O5
Network6
Nginx111
Apache112
FPM113
Redis114
KeyDB115
Supervisor116
Docker117
MySQL118
MongoDB119
HAProxy120
Last Updated: 8/14/2023, 8:12:12 PM