SQL - Agents Interrupted During Patching

Useful script s and methods to resolve complicated issues in ConnectWise Automate
Post Reply
User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

SQL - Agents Interrupted During Patching

Post by Cubert »

Interrupted Patching

Code: Select all

SELECT cmd.`ComputerID` AS 'ID',
     cl.name AS 'Client',
     c.name AS 'Hostname',
     c.OS AS 'OS',
     c.LastContact AS 'Last Contact',
     cmd.DateUpdated AS 'Start Time',
     (LENGTH (cmd.parameters) - LENGTH(REPLACE(cmd.parameters, ',', '')))+1
AS 'Patches Installing',
     (ROUND(TIME_TO_SEC(TIMEDIFF(NOW(),cmd.DateUpdated))/60)-1) AS 'Elapsed
Time (m)'
FROM commands cmd LEFT JOIN computers c ON (c.computerid = cmd.computerid)
JOIN clients cl ON (cl.clientid = c.clientid)
WHERE command = 100 AND STATUS = 2
AND c.LastContact < DATE_SUB(NOW(), INTERVAL 30 MINUTE)
ORDER BY `Patches Installing` DESC

Post Reply

Return to “Scripts”