Client Management Suite

 View Only
  • 1.  custom report with drive space % free

    Posted Aug 16, 2017 02:31 PM

    ok so there is a canned report that shows how big the drive is, how much space is free and how much space is used...

    With that I was able to come up with what I would like, but cannot figure out how to calculate the % free. anyone assist or have a type report I can use?

     

    select t1.Name, t0.[Free Space (Bytes)] / (1024 * 1024) AS 'Free (MB)', t0.[Size (Bytes)] / (1024 * 1024) AS 'Total Size (MB)',
     (t0.[Size (Bytes)] / (t0.[Free Space (Bytes)] * 100)) AS 'Free Percent'
    from vHWLogicalDisk t0
     join Inv_AeX_AC_Identification t1 on t0._ResourceGuid = t1._ResourceGuid
    where t0.Name = 'c:'


  • 2.  RE: custom report with drive space % free
    Best Answer

    Posted Aug 17, 2017 07:15 AM

    Hi,

     

    this may be not the nicest SQL style, but it will do the Job:

     

    select t1.Name, t0.[Free Space (Bytes)] / (1024 * 1024) AS 'Free (MB)', t0.[Size (Bytes)] / (1024 * 1024) AS 'Total Size (MB)',
    CAST((CAST(t0.[Free Space (Bytes)] AS FLOAT) / CAST(t0.[Size (Bytes)] AS FLOAT) ) * CAST(100 AS FLOAT) AS DECIMAL(10,2)) AS 'Free Percent'

    from vHWLogicalDisk t0
     join Inv_AeX_AC_Identification t1 on t0._ResourceGuid = t1._ResourceGuid
    where t0.Name = 'c:'



  • 3.  RE: custom report with drive space % free

    Posted Aug 17, 2017 09:40 AM
      |   view attached

    pffft once i hit save all that jibberishly not the nicest but fully works great job... looks clean!!!!!!!!! HAH..

     

    Works great.. i can get by with minimal sql as I do not know much but have been ok for years. That " AS FLOAT " is new to me.. wow... appreciate it!

     



  • 4.  RE: custom report with drive space % free

    Posted Aug 18, 2017 08:33 AM

    How to Report on Available Disk Space on All Computers as Well as Only on Site Servers
    https://www.symantec.com/connect/articles/how-report-available-disk-space-all-computers-well-only-site-servers



  • 5.  RE: custom report with drive space % free

    Posted Aug 21, 2017 09:08 AM

    ^^ wow that is a nice report there...

    I added this to the comments but do you know how to add this?

    this has worked very well on my 7.6 environment...

    how can I add a " AND " to the where free space % less than X (will be an editable field) ?



  • 6.  RE: custom report with drive space % free

    Posted Aug 21, 2017 12:39 PM


  • 7.  RE: custom report with drive space % free

    Posted Aug 22, 2017 09:34 AM

    understood about the query and report parameter.. ive done those but not sure how to do so where i want the t0.[Free Space (Bytes)] / (1024 * 1024) AS 'Free (MB)'​ part... i know i can add the where [Free Space (bytes) but I would rather have the techs put in MB as that line from the select statement converts it form bytes to mb



  • 8.  RE: custom report with drive space % free

    Posted Aug 22, 2017 11:17 AM

    Sorry I don't understand what you mean, you would like the report to have a parameter that a tech enters, this being in MB and it bring back computers that have Free Space less than this amount?

    So a Tech enters 100MB in the Report Parameter and it shows all computers with less than that Free Space?



  • 9.  RE: custom report with drive space % free

    Posted Aug 22, 2017 11:25 AM

    yes.. currently they will have to enter it in bytes... so 100 is 100000000 or something

     



  • 10.  RE: custom report with drive space % free

    Posted Aug 23, 2017 03:50 AM

    Just convert the value they pass