Jump to content

SQL to enumerate effective alert templates


Recommended Posts

SELECT mastergroups.fullname AS GroupName, 
       groupagents.name      AS MonitorName, 
       alerttemplate.name    AS AlertTemplateName 
FROM   groupagents 
       LEFT JOIN alerttemplate 
              ON groupagents.alertaction = alerttemplate.alertactionid 
       LEFT JOIN mastergroups 
              ON groupagents.groupid = mastergroups.groupid 
WHERE  alerttemplate.name NOT LIKE '%Do Nothing%' 
UNION 
SELECT 'Global Internal Monitor' AS GroupName, 
       agents.name               AS MonitorName, 
       alerttemplate.name        AS AlertTemplateName 
FROM   agents 
       LEFT JOIN alerttemplate 
              ON agents.alertaction = alerttemplate.alertactionid 
WHERE  checkaction = 0 
       AND alerttemplate.name NOT LIKE '%Do Nothing%' 
UNION 
SELECT mastergroups.fullname AS GroupName, 
       agents.name           AS MonitorName, 
       alerttemplate.name    AS AlertTemplateName 
FROM   groupdagents 
       LEFT JOIN alerttemplate 
              ON groupdagents.alertaction = alerttemplate.alertactionid 
       LEFT JOIN mastergroups 
              ON groupdagents.groupid = mastergroups.groupid 
       LEFT JOIN agents 
              ON groupdagents.agentid = agents.agentid 
WHERE  alerttemplate.name NOT LIKE '%Do Nothing%' 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...