/build/static/layout/Breadcrumb_cap_w.png

Report of Installed / Failed Patches for a Patch Label

I have a Patch Schedule to install patches under a Patch Label to devices in a Device Label. After running the schedule, it completes and I see the "Show All" in the schedule.  However, im not sure how to get this data out, on a schedule, in a more "management friendly" format.  Is there a report or can anyone help with a sql query to report on a patch schedule? I would like to show the machines in the label, show the patches in the patch label, and report on if the patches were installed or failed. Does this make sense?


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: chucksteel 5 years ago
Red Belt
1

Top Answer

A report that shows the individual patches per machine would either be very long or very difficult to read. Here is a report that shows the patching status per machine and patching schedule (machines will show multiple times if they have more than one patching schedule applied):

SELECT MACHINE.ID, MACHINE.NAME, P.DESCRIPTION, PSMS.PATCHED, PSMS.NOTPATCHED, PSMS.DETECT_FAILURES, PSMS.LAST_RUN, K.PHASE, K.TYPE
FROM PATCHLINK_SCHEDULE_MACHINE_STATUS PSMS
JOIN MACHINE on MACHINE.ID = PSMS.MACHINE_ID
JOIN PATCHLINK_SCHEDULE P on P.ID = PSMS.PATCHLINK_SCHEDULE_ID
JOIN KBSYS.KONDUCTOR_TASK K ON P.KONDUCTOR_TASK_TYPE = K.TYPE and K.KUID = MACHINE.KUID
JOIN MACHINE_LABEL_JT on MACHINE_LABEL_JT.MACHINE_ID = MACHINE.ID
JOIN LABEL on LABEL.ID = MACHINE_LABEL_JT.LABEL_ID
WHERE 
LABEL.NAME = "User Services"
ORDER BY MACHINE.NAME

Here is another one that is more specific and I wrote for http://www.itninja.com/question/show-update-software-packages-in-different-scripts 

SELECT M.NAME AS MACHINE_NAME, M.ID,
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 MACHINE M
LEFT JOIN PATCHLINK_MACHINE_STATUS MS ON (M.ID = MS.MACHINE_ID)
LEFT JOIN KBSYS.PATCHLINK_PATCH PP ON 
(MS.PATCHUID = PP.UID AND PP.IMPACTID = 'Critical' 
AND RELEASEDATE between DATE_SUB(NOW(),INTERVAL 60 DAY) and DATE_SUB(NOW(),INTERVAL 30 DAY)
AND PP.IS_SUPERCEDED = 0)
LEFT JOIN PATCHLINK_PATCH_STATUS PPS ON (PP.UID = PPS.PATCHUID AND PPS.STATUS = 0)
JOIN MACHINE_LABEL_JT ML ON (M.ID = ML.MACHINE_ID)
JOIN LABEL L ON (ML.LABEL_ID = L.ID)
WHERE L.NAME = 'Test Patching'
GROUP BY M.NAME
ORDER BY PERCENT_PATCHED, M.NAME

This has the critical status and release date restrictions removed:

SELECT M.NAME AS MACHINE_NAME, M.ID,
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 MACHINE M
LEFT JOIN PATCHLINK_MACHINE_STATUS MS ON (M.ID = MS.MACHINE_ID)
LEFT JOIN KBSYS.PATCHLINK_PATCH PP ON MS.PATCHUID = PP.UID AND PP.IS_SUPERCEDED = 0
LEFT JOIN PATCHLINK_PATCH_STATUS PPS ON (PP.UID = PPS.PATCHUID AND PPS.STATUS = 0)
JOIN MACHINE_LABEL_JT ML ON (M.ID = ML.MACHINE_ID)
JOIN LABEL L ON (ML.LABEL_ID = L.ID)
WHERE L.NAME = 'Test Patching'
GROUP BY M.NAME
ORDER BY PERCENT_PATCHED, M.NAME

If none of these work, let me know. 


Comments:
  • Thanks. It helps a lot! - lama01 5 years ago
Posted by: AbhayR 5 years ago
Red Belt
0

Have you checked all the built in Patching reports ?

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ