Make a report only look at C drive space?
Hello,
I have a report set up that emails me daily with machines who have less than 5 GB of space left on their hard drives. This report has been set up for years and works great to intercept problems before they start. (Windows 7 machines)
Google has recently introduced a tool called Drive File Stream. It mounts a drive ("G") and allows users to access their Google Drive storage through Windows Explorer. The tool mounts that as a drive letter, and the kbox agent is picking that up... But there is no space on that drive since it's just "streaming" it to Google... Here's what the inventory looks like:
So my report is picking up those machines who have installed that utility, and therefore an inaccurate report on who is short on space is being generated.
I'm trying to figure out if I can 1) limit the report to only look at C or 2) somehow else have it ignore Google Drive File Stream.
Thanks!
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
chucksteel
7 years ago
Here is the report that I use:
SELECT M.ID, M.NAME, D.NAME as "Disk Name", D.DISK_SIZE, D.DISK_USED, D.DISK_FREE
FROM ORG1.MACHINE M
JOIN MACHINE_DISKS D on M.ID = D.ID
WHERE DISK_FREE < 10 and DISK_SIZE > 0
AND (D.NAME like "Drive C:%" OR D.NAME like "Drive / %")
Note that I am checking for disks with less than 10GB free. In your case, adding the DISK_SIZE > 0 should filter out the Google Drive mount, but adding the limit on drive name will help. Also, my report targets both Windows and macOS devices, so I also make sure the drive is the root volume.
Comments:
-
Thanks! I think what I'm really looking for is a way to do this in the wizard. My query limits some results to just one building (based on name) and also manually excludes some machines, and - not being an SQL expert - I was hoping for an easy way to accomplish this... Though I fear I'm at the mercy of the K1 software if I want to use the wizard.
For what it's worth, this is my current query:
SELECT MACHINE.NAME AS SYSTEM_NAME, SYSTEM_DESCRIPTION, MACHINE.IP, MACHINE.MAC, MACHINE.ID as TOPIC_ID FROM MACHINE LEFT JOIN MACHINE_DISKS ON (MACHINE_DISKS.ID = MACHINE.ID) WHERE ((MACHINE_DISKS.DISK_FREE < '5') AND (MACHINE.NAME like '%vhs%') AND (MACHINE.NAME != 'VHS-SPED17INCH')) GROUP BY MACHINE.ID - sundermannc@wdmcs.org 7 years ago-
Change this: (MACHINE_DISKS.DISK_FREE < '5')
to this:
(MACHINE_DISKS.DISK_FREE < 5 and MACHINE_DISKS.DISK_SIZE > 0) - chucksteel 7 years ago-
Thank you, that worked! - sundermannc@wdmcs.org 7 years ago
-
Thank you, that worked! - sundermannc@wdmcs.org 7 years ago