Server Patching Report
Hi All,
I'm trying to create a report that gives us a report of server that have total patches deployed and total patches detected. with the code below i'm getting a list of all deployed and detected for each server.
How do I group them and get the totals?
SELECT MACHINE.NAME AS SYSTEM_NAME, (group_concat(distinct concat(KBSYS.PATCHLINK_PATCH.TITLE,' (',IDENTIFIER,') - ',PATCHLINK_MACHINE_STATUS.DEPLOY_STATUS) order by KBSYS.PATCHLINK_PATCH.TITLE separator '\n')) as DEPLOY_STATUS, group_concat(distinct concat(KBSYS.PATCHLINK_PATCH.TITLE,' (',IDENTIFIER,') - ',PATCHLINK_MACHINE_STATUS.STATUS) order by KBSYS.PATCHLINK_PATCH.TITLE separator '\n') as DETECT_STATUS
FROM MACHINE left join PATCHLINK_MACHINE_STATUS on PATCHLINK_MACHINE_STATUS.MACHINE_ID = MACHINE.ID LEFT JOIN KBSYS.PATCHLINK_PATCH ON (KBSYS.PATCHLINK_PATCH.UID = PATCHLINK_MACHINE_STATUS.PATCHUID)
WHERE ((( exists (select 1 from LABEL, MACHINE_LABEL_JT where MACHINE.ID = MACHINE_LABEL_JT.MACHINE_ID AND MACHINE_LABEL_JT.LABEL_ID = LABEL.ID AND LABEL.TYPE <> 'hidden' and LABEL.NAME = 'C_Servers')) )) GROUP BY MACHINE.ID ORDER BY SYSTEM_NAME
I'm after the below:
Server | Deployed Patches | Detected Patches |
Server01 | 54 | 156 |
1 Comment
[ + ] Show comment
-
is anyone able to help with this? I still don't have it fixed. - chris.poston 9 years ago
Answers (0)
Please log in to answer
Be the first to answer this question