Lansweeper logo
Home Download Features Demo Buy now Help Support forum
 
    Most requested support articles:
  Lansweeper troubleshooting guide.
  The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
  WMI Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  How to configure the windows firewall using group policies.
  Support:  
 support@lansweeper.com  
Skype: Lansweeper  
  Mo-Fri 9h-17h CET  
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
Hard disk Report for Server HD partitions
WildPh
#1 Posted : Monday, August 16, 2010 6:10:05 PM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
I would like to generate a report which shows all server partitions that have less than:
20% diskspace with a yellow "signal light"
10% diskspace with a red "signal light"

I would like to show them in the dashboard and have it send via Mail Report as Excel attachments.

Thanks for your support.
Lansweeper
#2 Posted : Tuesday, August 17, 2010 9:11:22 AM

Rank: Administration

Groups: Administration, Premium Users
Posts: 10,007
Currently you can't add pictures inside the reports, you will need to add the wording "red" or "yellow"
WildPh
#3 Posted : Tuesday, August 17, 2010 9:26:06 AM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
That's OK with the wording. But which report generates information needed?
Lansweeper
#4 Posted : Tuesday, August 17, 2010 9:04:26 PM

Rank: Administration

Groups: Administration, Premium Users
Posts: 10,007
try this:

Code:
Select Top 1000000 dbo.tblComputers.Computername,
  dbo.tblComputers.ComputerUnique, Web40OSName.OSname,
  dbo.tblOperatingsystem.Description, dbo.tblDiskdrives.Caption,
  Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
  Free, Floor(Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 /
  1024 As numeric) / Cast(Cast(dbo.tblDiskdrives.Size As bigint) / 1024 /
  1024 As numeric) * 100) As Freepct, Cast(Cast(dbo.tblDiskdrives.Size
  As bigint) / 1024 / 1024 As numeric) As [Total size],
  dbo.tblDiskdrives.Lastchanged As [Last changed], Web40OSName.Compimage As icon
From dbo.tblComputers Inner Join
  dbo.tblDiskdrives On dbo.tblComputers.Computername =
    dbo.tblDiskdrives.Computername Inner Join
  dbo.tblOperatingsystem On dbo.tblComputers.Computername =
    dbo.tblOperatingsystem.Computername Inner Join
  dbo.web40ActiveComputers On dbo.tblComputers.Computername =
    dbo.web40ActiveComputers.Computername Inner Join
  Web40OSName On Web40OSName.Computername = dbo.tblComputers.Computername
  Inner Join
  tblComputersystem On dbo.tblComputers.Computername =
    tblComputersystem.Computername
Where Floor(Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 /
  1024 As numeric) / Cast(Cast(dbo.tblDiskdrives.Size As bigint) / 1024 /
  1024 As numeric) * 100) <= 20 And Cast(Cast(dbo.tblDiskdrives.Size As bigint)
  / 1024 / 1024 As numeric) <> 0 And tblComputersystem.Domainrole > 1 And
  dbo.tblDiskdrives.DriveType = '3'
Order By Floor(Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 /
  1024 As numeric) / Cast(Cast(dbo.tblDiskdrives.Size As bigint) / 1024 /
  1024 As numeric) * 100), Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) /
  1024 / 1024 As numeric), dbo.tblDiskdrives.Caption
WildPh
#5 Posted : Tuesday, August 17, 2010 10:12:16 PM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
Thanks for sql statement. Works just fine. I would like filter the query with a where statement: where costcenter=1825. We renamed the custom field 1 in the extra field section.
WildPh
#6 Posted : Wednesday, August 18, 2010 9:18:36 PM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
I still have this issue with the where clause. How could help me with this?
Lansweeper
#7 Posted : Thursday, August 19, 2010 9:04:30 AM

Rank: Administration

Groups: Administration, Premium Users
Posts: 10,007
Try this:
Code:
Select Top 1000000 dbo.tblComputers.Computername,
  dbo.tblComputers.ComputerUnique, Web40OSName.OSname,
  dbo.tblOperatingsystem.Description, dbo.tblDiskdrives.Caption,
  Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
  Free, Floor(Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 /
  1024 As numeric) / Cast(Cast(dbo.tblDiskdrives.Size As bigint) / 1024 /
  1024 As numeric) * 100) As Freepct, Cast(Cast(dbo.tblDiskdrives.Size
  As bigint) / 1024 / 1024 As numeric) As [Total size],
  dbo.tblDiskdrives.Lastchanged As [Last changed], Web40OSName.Compimage As
  icon, tblCompCustom.Custom1
From dbo.tblComputers Inner Join
  dbo.tblDiskdrives On dbo.tblComputers.Computername =
    dbo.tblDiskdrives.Computername Inner Join
  dbo.tblOperatingsystem On dbo.tblComputers.Computername =
    dbo.tblOperatingsystem.Computername Inner Join
  dbo.web40ActiveComputers On dbo.tblComputers.Computername =
    dbo.web40ActiveComputers.Computername Inner Join
  Web40OSName On Web40OSName.Computername = dbo.tblComputers.Computername
  Inner Join
  tblComputersystem On dbo.tblComputers.Computername =
    tblComputersystem.Computername Inner Join
  tblCompCustom On dbo.tblComputers.Computername = tblCompCustom.Computername
Where Floor(Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 /
  1024 As numeric) / Cast(Cast(dbo.tblDiskdrives.Size As bigint) / 1024 /
  1024 As numeric) * 100) <= 20 And Cast(Cast(dbo.tblDiskdrives.Size As bigint)
  / 1024 / 1024 As numeric) <> 0 And tblComputersystem.Domainrole > 1 And
  dbo.tblDiskdrives.DriveType = '3' And tblCompCustom.Custom1 = '1825'
Order By Floor(Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) / 1024 /
  1024 As numeric) / Cast(Cast(dbo.tblDiskdrives.Size As bigint) / 1024 /
  1024 As numeric) * 100), Cast(Cast(dbo.tblDiskdrives.Freespace As bigint) /
  1024 / 1024 As numeric), dbo.tblDiskdrives.Caption
WildPh
#8 Posted : Thursday, August 19, 2010 10:29:28 PM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
Works great. But the label in the table is still called Custom1. How can I change the caption? I tried with As [Cost Center].
WildPh
#9 Posted : Thursday, August 19, 2010 10:39:47 PM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
I've just seen that in some cases the calculation ist not correct:

Computer OSname Description Caption Free Freepct Total size Date Custom1
Chsrv008 Win 2003File Server G: 52278 17 307196 17/08/2010 9001

In this case the free space (52278) is > 0.1 times 307196.
Lansweeper
#10 Posted : Friday, August 20, 2010 2:14:57 AM

Rank: Administration

Groups: Administration, Premium Users
Posts: 10,007
The "floor" function cuts off the numbers after the comma.
WildPh
#11 Posted : Friday, August 20, 2010 5:47:07 AM

Rank: Premium user

Groups: Premium Users
Posts: 30
Location: Switzerland
Could we omit the floor function in order to get "better" results?
Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Contact: E-mail Lansweeper - Skype : Lansweeper
Copyright 2004 - 2011 © Hemoco bvba