The Send Test Events feature of Alert Management allows you to verify whether an event integration is created. This topic describes how to send test events to a custom event integration.
Scenario
The following scenario is used in the example:
The operation and maintenance personnel of a company need to monitor a server because of an upcoming large-scale event. After connecting the server to Application Real-Time Monitoring Service (ARMS) for monitoring, O&M personnel send a test event to test the connectivity of the server.
Scenario for the test event:
When the memory usage of the server exceeds 80%, the system sends an alert notification that contains the following information:
The data center where the server resides
The ID of the server
The IP address of the server
The name of the server
The current memory usage
Step 1: Create a custom event integration
- Log on to the ARMS console. In the left-side navigation pane, choose .
On the Alert Integrations tab, click Custom Integration.
In the Create Custom Event Integration dialog box, enter a name and description (optional) for the integration, and specify the period of time after which alerts are cleared, and then click Save and Configure.
Note If an alert event is not triggered again within the specified period of time, the alert event is automatically cleared.Click the name of the created integration. In the Event Mapping section on the Integration Details page, click Send Test Data.
In this example, the current memory usage of No.01 server (ip:192.168.xx.xx,id:i-123) in data center A is 82.14%.
Enter the following information and click Send.
{ "message": "The current memory usage of the sever {$ labels.vm_name}} (ip:{{$labels.vm_ip}}, id: {{$labels.vm_id}}) in the data center {{$labels.idc_id}} is {{$ value | humanizePercentage}}, which is greater than 80% and triggers an alert. ", "vm_name": "No.01", "vm_id":"i-123", "vm_ip": "192.168.xx.xx", "value":"0.8214", "idc_id":"A", "alertname": "Server memory usage exceeds 80%" }
- In the Send Test Data dialog box, click Disable.
- In the left part of the Event Mapping section, click the data records for which you want to configure mappings to view the details.
In the right part of the Event Mapping section, map source fields to target fields.
In this topic, the following fields are added. You can customize the fields based on your business requirements. For more information, see Integrate a custom alert source with ARMS.
Type
Field
Description
Value
Default fields
Alert name
The name of the alert.
$.alertname
Alert description
The details of the alert, which is used for alert notifications.
$.message
Value
The value in this case is the current memory usage.
$.value
Extended fields
vm_id
The ID of the server.
$.vm_id
vm_ip
The IP address of the server.
$.vm_ip
idc_id
The ID of the data center.
$.idc_id
vm_name
The name of the server.
$.vm_name
Click Save.
Step 2: Send a test event
- Log on to the ARMS console.
In the left-side navigation pane, choose .
On the Events page, click Send Test Events.
In the Send Test Event dialog box, select the server integration that you create from the Integration Name drop-down list.
In the Event Content field, enter the field values for the test event.
In this example, the current memory usage of No.01 server (ip:192.168.xx.xx,id:i-123) in data center A is 82.14%.
Then, enter the following information:
{ "message": "The current memory usage of the sever {$ labels.vm_name}} (ip:{{$labels.vm_ip}}, id: {{$labels.vm_id}}) in the data center {{$labels.idc_id}} is {{$ value | humanizePercentage}}, which is greater than 80% and triggers an alarm. ", "vm_name": "No.01", "vm_id":"i-123", "vm_ip": "192.168.xx.xx", "value":"0.8214", "idc_id":"A", "alertname": "Server memory usage exceeds 80%" }
Click OK.
If the following message appears:
Upload complete 1 event is uploaded.
, the test event is sent.
Step 3: View the test event that you receive
- Log on to the ARMS console.
In the left-side navigation pane, choose .
On the Events page, view the test events that you send.
Click the name of a test event to view the details of its fields.