Created
July 8, 2016 16:40
-
-
Save jacksoneyton/3aad10d5394f51dc8b05b6e5f878b50d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT cmd.`ComputerID` AS 'ID', | |
cl.name AS 'Client', | |
c.name AS 'Hostname', | |
c.OS AS 'OS', | |
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 | |
JOIN computers c ON (c.computerid = cmd.computerid) | |
JOIN clients cl ON (cl.clientid = c.clientid) | |
WHERE cmd.command = 100 AND `status` = 2 | |
ORDER BY `Patches Installing` DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment