Metricly
and select the card.
name
for the webhook notification.Name
the Webhook.username
and password
if required.The endpoint URL must return an HTTP code 200
to pass the validation.
Add one or more headers (key-value pairs) to the webhook notification.
Select Custom from the Payload drop-down menu. A text field will open after selecting Custom. You can use the following variables and/or VictorOps fields to make your notification more dynamic.
Example The below example sends a notification that states the event’s category name, the name and ID of the element in violation, and the policy name of the violating element. Once the event has ended, it sends a RECOVERY notification stating the time that the event ended.
{
"message_type":"<#if payloadType == "event">${eventCategory.name}</#if><#if payloadType == "event_cleared">RECOVERY</#if>",
"entity_id":"${elementId}",
"entity_display_name":"${elementName}",
"state_message":"<#if payloadType == "event"> [${elementName}] [${policyName}] [${eventTimestamp}] : ${policyDescription}</#if><#if payloadType == "event_cleared">The policy ${policyName} has CLEARED for ${elementName} and is no longer generating events as of ${eventTimestamp}</#if>"
}
You can visit the VictorOps knowledge base for more information.
Field Name | Description |
---|---|
message_type | String value. This field allows the following values: INFO, WARNING, ACKNOWLEDGMENT, CRITICAL, RECOVERY. |
entity_id | String value. The name of the alerting entity. |
timestamp | Number value. Timestamp of the alert in seconds since epoch. |
state_start_time | Number value. The time the entity entered its current state (in seconds since epoch). |
state_message | String value. Any additional status information from the alert. |
monitoring_tool | String value. The name of the monitoring system software/application. |
Variable | Description |
---|---|
${elementFqn} | The Fully Qualified Name (FQN) of the element. |
${elementId} | The type of element (e.g., SERVER, ELB, EC2, RDS, etc.). |
${elementLocation} | The location of the element. |
${elementName} | The friendly name for the element. |
${elementType} | The type of element (e.g, SERVER, ELB, RUBY, etc.) |
${event.data.results} | The description of the event as a policy violation. |
${event.id} | The ID of the event |
${eventCategory.name} | The event category ( (Info), (Warning), or (Critical)). |
${eventTimestamp} | The time (in UTC) the event occurred. |
${policyDescription} | The description of the policy that generated the event. |
${policyId} | The policy identification number. |
${policyName} | The name of the policy. |
{
"message_type":"INFO",
"entity_is_host":"Yes",
"entity_id":"${elementId}",
"state_message":"${elementName} is up,
but an event occurred at ${eventTimestamp}."
}