Notification

Icon
Error

Reporting on low HDD space for 2 servers

Posted: Friday, June 26, 2020 4:41:18 PM(UTC)
Samuel1222

Samuel1222

Member Original PosterPosts: 2
0
Like
Hey, I'm trying to make an alert / report for two servers in the case that they get low disk space.

The report I have right now doesn't seem to care about the free space left and just shows all of the drives, as well as only showing one server instead of both via IP. Please see below

Code:
Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.IPAddress,
  tblDiskdrives.Caption,
  Ceiling(tblDiskdrives.Freespace / 1024 / 1024 / 1024) As FreeGB,
  Ceiling((tblDiskdrives.Size / 1024 / 1024 / 1024) - (tblDiskdrives.Freespace /
  1024 / 1024 / 1024)) As UsedGB,
  Ceiling(tblDiskdrives.Size / 1024 / 1024 / 1024) As TotalGB,
  tblAssets.Lastseen
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Where (tblAssets.IPAddress Like '192.168.1.31') Or
  (tblAssets.IPAddress Like '192.168.1.34' And Cast(tblDiskdrives.Freespace /
  1024 / 1024 / 1024 As numeric) < 100 And Cast(tblDiskdrives.Size / 1024 /
  1024 / 1024 As numeric) <> 0 And Cast(tblDiskdrives.Size / 1024 / 1024 /
  1024 As numeric) > 10 And tblAssetCustom.State = 1 And
  tblDiskdrives.DriveType = 3)
Order By tblAssets.Domain,
  tblAssets.AssetName,
  tblDiskdrives.Caption
RC62N
#1RC62N Member Posts: 450  
posted: 6/26/2020 6:03:40 PM(UTC)
Step 1 would be to adjust the logic in your WHERE clause. Change it from
Code:
Where
  (tblAssets.IPAddress Like '192.168.1.31')
  Or ( tblAssets.IPAddress Like '192.168.1.34'
       And Cast(tblDiskdrives.Freespace / 1024 / 1024 / 1024 As numeric) < 100
       And Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) <> 0
       And Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) > 10
       And tblAssetCustom.State = 1
       And tblDiskdrives.DriveType = 3
     )
to
Code:
Where
  (tblAssets.IPAddress Like '192.168.1.31' Or tblAssets.IPAddress Like '192.168.1.34')
  And Cast(tblDiskdrives.Freespace / 1024 / 1024 / 1024 As numeric) < 100
  And Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) <> 0
  And Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) > 10
  And tblAssetCustom.State = 1
  And tblDiskdrives.DriveType = 3
Samuel1222
#2Samuel1222 Member Original PosterPosts: 2  
posted: 6/26/2020 8:32:47 PM(UTC)
Hell yeah man that's perfect! Thank you

Active Discussions

Lansweeper Help Desk Workflow
by  lswanson   Go to last post Go to first unread
Last post: Yesterday at 11:12:21 PM(UTC)
Lansweeper Changing to remote scanning due to COVID
by  FrankSc  
Go to last post Go to first unread
Last post: Yesterday at 9:35:26 PM(UTC)
Lansweeper Not giving hackers the Domain Admin password / account
by  FrankSc   Go to last post Go to first unread
Last post: Yesterday at 9:27:13 PM(UTC)
Lansweeper LsAgent failing - Lansweeper SSL Expired
by  lansweeper25t34  
Go to last post Go to first unread
Last post: Yesterday at 8:33:28 PM(UTC)
Lansweeper Is there a chance to get the firewall off via Lansweeper?
by  EDV_OHZ   Go to last post Go to first unread
Last post: Yesterday at 4:57:26 PM(UTC)
Lansweeper Merge Asset button
by  KeithBecker  
Go to last post Go to first unread
Last post: 8/5/2020 9:27:54 PM(UTC)
Lansweeper Merge Two Assets or Update Based on Serial Number
by  KeithBecker   Go to last post Go to first unread
Last post: 8/5/2020 9:25:16 PM(UTC)
Lansweeper Hyper-V guest assets
by  bgstein  
Go to last post Go to first unread
Last post: 8/5/2020 5:50:24 PM(UTC)