SQLMonitor integration with ServiceNow

BazzFreemanBazzFreeman Posts: 3 Bronze 1
edited June 22, 2022 12:45PM in Redgate Monitor
Since SQLM can send webhooks, I set up a resource in our ServiceNow instance.
Test / Preview shows it's working.
But alerts don't seem to be firing the webhook.  I set ALL alerts to enable webhook. 
We've had a couple of disk space alerts this morning but no incidents were created.
Tagged:

Answers


  • There are a few things we can do to check what is happening with the webhooks.
     
    Can you run the script below against the base monitor database to check if the webhook is enabled?
     
    SELECT  'Root' Level, NULL Name1, NULL Name2, NULL Name3, alert.Alert_Type.AlertType, alert.Alert_Type.Name AS 'Alert Name', SubType, Configuration, Enabled, AlertNotification, EmailAddress, Version, WebhookEnabled<br>FROM    config.AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.AlertConfiguration_View.AlertType<br>UNION ALL<br>SELECT  'Group', Group_Name, NULL, NULL, Group_AlertType, alert.Alert_Type.Name, Group_SubType, Group_Configuration, Group_Enabled, Group_AlertNotification, Group_EmailAddress, Group_Version, Group_WebhookEnabled<br>FROM    config.Group_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Group_AlertConfiguration_View.Group_AlertType<br>UNION ALL<br>SELECT  'Cluster', Cluster_Name, NULL, NULL, Cluster_AlertType, alert.Alert_Type.Name, Cluster_SubType, Cluster_Configuration, Cluster_Enabled, Cluster_AlertNotification, Cluster_EmailAddress, Cluster_Version, Cluster_WebhookEnabled<br>FROM    config.Cluster_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Cluster_AlertConfiguration_View.Cluster_AlertType<br>UNION ALL<br>SELECT  'Machine', Cluster_Name, Cluster_Machine_Name, NULL, Cluster_Machine_AlertType, alert.Alert_Type.Name, Cluster_Machine_SubType, Cluster_Machine_Configuration, Cluster_Machine_Enabled, Cluster_Machine_AlertNotification, Cluster_Machine_EmailAddress, Cluster_Machine_Version, Cluster_Machine_WebhookEnabled<br>FROM    config.Cluster_Machine_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Cluster_Machine_AlertConfiguration_View.Cluster_Machine_AlertType<br>UNION ALL<br>SELECT  'SqlServer', Cluster_Name, Cluster_SqlServer_Name, NULL, Cluster_SqlServer_AlertType, alert.Alert_Type.Name, Cluster_SqlServer_SubType, Cluster_SqlServer_Configuration, Cluster_SqlServer_Enabled, Cluster_SqlServer_AlertNotification, Cluster_SqlServer_EmailAddress, Cluster_SqlServer_Version, Cluster_SqlServer_WebhookEnabled<br>FROM    config.Cluster_SqlServer_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Cluster_SqlServer_AlertConfiguration_View.Cluster_SqlServer_AlertType<br>UNION ALL<br>SELECT  'Database', Cluster_Name, Cluster_SqlServer_Name, Cluster_SqlServer_Database_Name, Cluster_SqlServer_Database_AlertType, alert.Alert_Type.Name, Cluster_SqlServer_Database_SubType, Cluster_SqlServer_Database_Configuration, Cluster_SqlServer_Database_Enabled, Cluster_SqlServer_Database_AlertNotification, Cluster_SqlServer_Database_EmailAddress, Cluster_SqlServer_Database_Version, Cluster_SqlServer_Database_WebhookEnabled<br>FROM    config.Cluster_SqlServer_Database_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Cluster_SqlServer_Database_AlertConfiguration_View.Cluster_SqlServer_Database_AlertType<br>UNION ALL<br>SELECT  'Job', Cluster_Name, Cluster_SqlServer_Name, Cluster_SqlServer_Agent_Job_Name, Cluster_SqlServer_Agent_Job_AlertType, alert.Alert_Type.Name, Cluster_SqlServer_Agent_Job_SubType, Cluster_SqlServer_Agent_Job_Configuration, Cluster_SqlServer_Agent_Job_Enabled, Cluster_SqlServer_Agent_Job_AlertNotification, Cluster_SqlServer_Agent_Job_EmailAddress, Cluster_SqlServer_Agent_Job_Version, Cluster_SqlServer_Agent_Job_WebhookEnabled<br>FROM    config.Cluster_SqlServer_Agent_Job_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Cluster_SqlServer_Agent_Job_AlertConfiguration_View.Cluster_SqlServer_Agent_Job_AlertType<br>UNION ALL<br>SELECT  'Disk', Cluster_Name, Cluster_Machine_Name, Cluster_Machine_LogicalDisk_Name, Cluster_Machine_LogicalDisk_AlertType, alert.Alert_Type.Name, Cluster_Machine_LogicalDisk_SubType, Cluster_Machine_LogicalDisk_Configuration, Cluster_Machine_LogicalDisk_Enabled, Cluster_Machine_LogicalDisk_AlertNotification, Cluster_Machine_LogicalDisk_EmailAddress, Cluster_Machine_LogicalDisk_Version, Cluster_Machine_LogicalDisk_WebhookEnabled<br>FROM    config.Cluster_Machine_LogicalDisk_AlertConfiguration_View<br>JOIN    alert.Alert_Type ON alert.Alert_Type.AlertType = config.Cluster_Machine_LogicalDisk_AlertConfiguration_View.Cluster_Machine_LogicalDisk_AlertType
     
    If the above script shows that webhook is enabled could you also run the script below to check if any webhook notifications are being sent?
    SELECT TOP 1000 [n].[AlertId]<br>       ,[utils].[TicksToDateTime]([n].[SeverityDate]) AS SeverityDate<br>       ,[utils].[TicksToDateTime]([n].[NotificationDate]) AS NotificationDate<br>       ,CASE<br>WHEN [n].[NotificationType] = 0 THEN 'Email'<br>WHEN [n].[NotificationType] = 1 THEN 'Slack'<br>WHEN [n].[NotificationType] = 2 THEN 'SNMP'<br>WHEN [n].[NotificationType] = 3 THEN 'Webhook'<br>END AS NotificationType<br>FROM [alert].[Notifications] AS [n]<br>WHERE [n].[NotificationType] = 3<br>ORDER BY n.NotificationDate DESC
    Best,
     
    Dustin 
Sign In or Register to comment.