
INSERT INTO `Agents` (`Name`,`LocID`,`ClientID`,`ComputerID`,`DriveID`,`CheckAction`,`AlertAction`,`AlertMessage`,`ContactID`,`interval`,`Where`,`What`,`DataOut`,`Comparor`,`DataIn`,`LastScan`,`LastFailed`,`FailCount`,`IDField`,`AlertStyle`,`Changed`,`Last_Date`,`Last_User`,`ReportCategory`,`TicketCategory`,`Flags`,`GUID`,`AgentDefaultGUID`,`WarningCount`,`DeviceId`) Values('CWA - Monitor Automate Plugins*','0','0','0','0','0','3','%NAME% Alert~~~%NAME% Notice:\r\nA plugin was deleted or disabled. Please review and confirm this was expected.\r\nPlugin ID:MD5:Plugin Name:Author:Description\r\n%FIELDNAME%\r\n!!!%NAME% Alert~~~%NAME% %STATUS%.\r\nA plugin was created or modified. Please review and confirm the following is valid.\r\n%RESULT%','1','300','RAWSQL','RAWSQL','SET @AgentID=1373\; \r\n\r\nDELETE FROM dba USING \r\ndatabasealerts AS dba\r\nJOIN \`plugins\` AS p ON p.PluginID=SUBSTRING_INDEX(dba.fieldname,\':\',1)\r\nWHERE dba.AgentID=@AgentID AND NOT CONCAT_WS(\':\', p.PluginId, p.MD5)=SUBSTRING_INDEX(dba.FieldName,\':\',2)\;\r\n\r\nSELECT CONCAT_WS(\' \\r\\n\',\r\nCONCAT_WS(\' \',\'Name:\',NULLIF(p.Name,\'\'),CONCAT(\'(ID \',p.PluginId, \')\')),\r\nCONCAT(\'Category: \',NULLIF(p.Category,\'\')),\r\nCONCAT(\'Version: \',NULLIF(p.Version,\'\')),\r\nCONCAT(\'Release Date: \',DATE(p.ReleaseDate)),\r\nCONCAT(\'Author: \',NULLIF(p.Author,\'\')),\r\nCONCAT(\'Description: \',NULLIF(p.Description,p.Name)),\r\nCONCAT(\'Type: \',IF(p.RemoteAgent=1,\'Remote Agent Plugin\',\'Server Plugin\')),\r\nCONCAT(\'Filename: \',p.FileName),\r\nCONCAT(\'Dependant On: \',NULLIF(p.DependantOn,\'\')),\r\nCONCAT(\'Is Official: \',IF(p.Official=1,\'Yes\',\'No\')),\r\nCONCAT(\'Is Community: \',IF(p.Community=1,\'Yes\',NULL)),\r\nCONCAT(\'Hidden: \',IF(p.Hidden=1,\'Yes\',NULL)),\r\nCONCAT(\'Load: \',IF(p.DoNotLoad=1,\'No\',NULL))\r\n) AS testvalue, \r\nCONCAT_WS(\':\', p.PluginId, p.MD5, p.Name, p.Author) AS identity, \r\n1 AS computerid, \'0\' AS noalerts, \'00:00:00\' AS uptimestart, \'23:59:59\' AS uptimeend \r\nFROM \`plugins\` AS p\r\nWHERE p.\`Enable\`=1\;\r\n','1','','2022/03/29 08:56:07','2022/03/29 08:56:07','3455','','0','0','2022/03/29 08:56:07','WYoung@localhost','0','0','1','596f009c-e85b-48c9-814e-8e694f91ff09','','0','0');
