{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":30374,"path":"it-operations-management/event-management/datadog-events-webhook.md","title":"Integrate Datadog with basic authentication","bundle":null,"doc_type":null,"release":"australia","body":"\n# Integrate Datadog with basic authentication\n\nIntegrate Datadog with Event Management by adding a standard webhook in the Datadog console.\n\n## Before you begin\n\nEnsure that the Event Management Connectors \\(sn\\_em\\_connector\\) plugin is installed on the ServiceNow AI Platform instance.\n\n-   Role required: evt\\_mgmt\\_integration\n-   The Event Management plugin must be installed on the ServiceNow AI Platform instance.\n-   Verify Configuration Items for the hosts managed by Datadog exist in ServiceNow. These CIs can be physical or virtual, and can be either manually created or discovered using IP discovery or Cloud discovery.\n\nEnsure you have created a user with an **Identify Type** of **Machine** and the evt\\_mgmt\\_integration role.\n\n## About this task\n\nConfigure the Event Management environment for the collection of events from Datadog. In your Datadog console, set your ServiceNow AI Platform instance as the rest endpoint using a standard webhook.\n\n## Procedure\n\n1.  In the Datadog console, add cloud provider tags:\n\n    1.  Navigate to **Menu** &gt; **Infrastructure** &gt; **Hosts**.\n\n    2.  Click **Inspect** for the VM on which the Datadog agent is installed.\n\n    3.  Click **Edit Tags** and add the cloud\\_provider tag.\n\n        The tag should be suffixed with the value of **aws**, **azure**, or **gcp** to identify the AWS, Microsoft Azure, or Google Cloud Platform \\(GCP\\) provider options. For example: cloud\\_provider:aws\n\n    4.  Click **Save Tags** to save the new tag.\n\n        **Note:** Datadog adds the cloud\\_provider tag by default when the Azure and Google integration is installed on the Datadog agent. Tags can also be added at the cloud provider level. Datadog collects all the tags defined at the VM level on the cloud.\n\n2.  In the Datadog console, add a webhook:\n\n    1.  Navigate to **Menu** &gt; **Integration** &gt; **Integrations**, and search for webhooks.\n\n    2.  Create a webhook that includes the user ID and password of the ServiceNow user in the endpoint.\n\n        For example, use `https://<username>:<password>@<instance-name>.service-now.com/api/sn_em_connector/em/inbound_event?source=datadog`.\n\n        **Note:** Ensure that the selected user is assigned the evt\\_mgmt\\_integration role. To ensure proper authentication, use the least privileged user with the evt\\_mgmt\\_integration role, rather than a high privileged user.\n\n    3.  Add in the following payload structure.\n\n        ```\n        { \n            \"body\": \"$EVENT_MSG\", \n            \"last_updated\": \"$LAST_UPDATED\", \n            \"event_type\": \"$EVENT_TYPE\", \n            \"title\": \"$EVENT_TITLE\", \n            \"date\": \"$DATE\", \n            \"org\": { \n                \"id\": \"$ORG_ID\", \n                \"name\": \"$ORG_NAME\" \n            }, \n            \"id\": \"$ID\", \n            \"alert_id\": \"$ALERT_ID\", \n            \"alert_metric\": \"$ALERT_METRIC\", \n            \"metric_namespace\": \"$METRIC_NAMESPACE\",\n            \"alert_priority\": \"$ALERT_PRIORITY\", \n            \"alert_transition\": \"$ALERT_TRANSITION\", \n            \"alert_status\": \"$ALERT_STATUS\", \n            \"alert_title\": \"$ALERT_TITLE\", \n            \"alert_type\": \"$ALERT_TYPE\", \n            \"host_name\": \"$HOSTNAME\", \n            \"priority\": \"$PRIORITY\", \n            \"tags\": \"$TAGS\", \n            \"alert_scope\": \"$ALERT_SCOPE\" \n        }  \n        ```\n\n3.  In the Datadog console, define rules:\n\n    1.  Navigate to **Menu** &gt; **Monitors** &gt; **Manage Monitors**, and configure rules on when to create a problem from Datadog on the managed hosts.\n\n    2.  In the **Notify your team** section, select the webhook on which the problem should be notified.\n\n\n## Result\n\nAlerts start flowing from Datadog agents into the Event Management plugin. The plugin extracts information from the original Datadog alert message to populate the required event fields and inserts the event into the database. In your ServiceNow AI Platform instance, navigate to **All Events** to see the events.\n\n**Note:** By default, host binding is enabled for Datadog events for \\(AWS/Azure/GCP\\) providers. If all hosts in the environment are discovered using Cloud Discovery by providing credentials and discovered resources are in the cmdb\\_ci\\_vm\\_object list, then the VM binding may not occur. To resolve this, you must enable the **Datadog - General** event rule. For further information about Event rules, see [Event rules](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/create-event-rules.md).\n\n"}}