The SQL Statement for our Patching listed by completion rate report is having some issues.  It was pulled from here on IT Ninja.  The problem is when a patch is part of a Microsoft Security Bulletin it is showing those patches as missing decreasing the patch percentage for each server even though the specific KB is installed.  There has to be another variable in a table that can generate a more accurate report.  I was unable to locate anything specific during my research.  Any assistance would be appreciated. Thanks!

SELECT M.NAME AS MACHINE_NAME,
OS_NAME AS WINDOWS_VERSION,
SUM(MS.STATUS='PATCHED') AS PATCHED,
SUM(MS.STATUS='NOTPATCHED') AS NOTPATCHED,
ROUND((SUM(MS.STATUS='PATCHED')/(SUM(MS.STATUS='PATCHED')
  +SUM(MS.STATUS='NOTPATCHED')))*100,0) AS PERCENT_PATCHED
FROM PATCHLINK_MACHINE_STATUS MS
JOIN KBSYS.PATCHLINK_PATCH PP ON (PP.UID = MS.PATCHUID)
JOIN PATCHLINK_PATCH_STATUS PPS ON (PPS.PATCHUID = PP.UID)
JOIN MACHINE M ON (M.ID = MS.MACHINE_ID)
JOIN MACHINE_LABEL_JT ML ON (M.ID = ML.MACHINE_ID)
JOIN LABEL L ON (ML.LABEL_ID = L.ID)
AND PPS.STATUS = 0
AND PP.IS_SUPERCEDED = 0
AND L.NAME = 'All Windows Servers'
GROUP BY M.NAME
ORDER BY PERCENT_PATCHED, M.NAME
1 Comment   [ + ] Show Comment

Comments

  • You might need to reconfigure the report to use the PATCHLINK_BULLETIN_MACHINE_STATUS table instead of the patch status.
Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity

Share