Hi Folks,

I need assistance with this report please - I am trying to add Ip Addresses to this report that shows number of systems, how many patches they are each missing with the IP address of the machine. But for some reason cannot get the IPs to show up.

Select M.NAME as MACHINE_NAME, M.USER, M.USER_FULLNAME, SUM(MS.STATUS='NOTPATCHED') AS NOT_PATCHED

FROM ORG1.PATCHLINK_MACHINE_STATUS MS JOIN ORG1.MACHINE M ON M.ID = MS.MACHINE_ID 

JOIN KBSYS.PATCHLINK_PATCH PP ON PP.UID = MS.PATCHUID 

JOIN PATCHLINK_PATCH_STATUS PPS ON PPS.PATCHUID = PP.UID 

JOIN ORG1.MACHINE_LABEL_JT ML ON (M.ID = ML.MACHINE_ID) 

JOIN LABEL L ON (ML.LABEL_ID = L.ID) 

where MS.STATUS='NOTPATCHED' AND PPS.STATUS = 0 /* 0=active patches */ 

and L.NAME LIKE ('%site systems%')

group by MACHINE_NAME

order by MACHINE_NAME

Answer Summary:
he IP address is stored in the MACHINE table in the IP column. In your query you have that table aliased to M so you can select it by adding M.IP to your select clause. Select M.NAME as MACHINE_NAME, M.USER, M.USER_FULLNAME, SUM(MS.STATUS='NOTPATCHED') AS NOT_PATCHED, M.IP
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answer Chosen by the Author

0
The IP address is stored in the MACHINE table in the IP column. In your query you have that table aliased to M so you can select it by adding M.IP to your select clause.
Select M.NAME as MACHINE_NAME, M.USER, M.USER_FULLNAME, SUM(MS.STATUS='NOTPATCHED') AS NOT_PATCHED, M.IP

That would add it as the last column in your report.

Answered 07/06/2016 by: chucksteel
Red Belt

  • Chuck, thank you this worked perfectly.
Please log in to comment

Answers

Answer this question or Comment on this question for clarity