-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGetGroupLevelEnabledInternalMonitors.sql
35 lines (30 loc) · 1.5 KB
/
GetGroupLevelEnabledInternalMonitors.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
Description : Get enabled internal monitors for each group in LabTech.
Source URL : http://github.com/jesseconnr/labtech-sql-library
Tested Versions :
MySQL 5.7
LabTech 10.0
Table Aliases :
Groups - mastergroups
InternalMonitors - groupdagents
MonitorDetails - agents
GroupCategories - infocategory
AlertTemplates - alerttemplate
*/
SELECT
CONCAT_WS(' - ', Groups.GroupID, Groups.Name) AS `GroupName`
, Groups.FullName AS `GroupPath`
, MonitorDetails.Name AS `Monitor`
, AlertTemplates.Name AS `AlertTemplate`
, GroupCategories.CategoryName AS `CategoryName`
FROM groupdagents AS `InternalMonitors`
LEFT JOIN agents AS `MonitorDetails` ON InternalMonitors.AgentID = MonitorDetails.AgentID
LEFT JOIN mastergroups AS `Groups` ON InternalMonitors.GroupID = Groups.GroupID
LEFT JOIN alerttemplate AS `AlertTemplates` ON InternalMonitors.AlertAction = AlertTemplates.AlertActionID
LEFT JOIN infocategory AS `GroupCategories` ON InternalMonitors.TicketCategory = GroupCategories.ID
WHERE (MonitorDetails.Flags & 0x01) = 0
#AND Groups.GroupID = 1580 # Group Id
#AND MonitorDetails.Name = 'AV - Disabled' # Internal Monitor Name
#AND AlertTemplates.Name = 'Default - Create LT Ticket' # Alert Template Name
#AND GroupCategories.CategoryName = 'Anti-Virus' # Ticket Category Name
ORDER BY Groups.FullName ASC;