→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sean_dineen
Engaged Sweeper
Can Lansweeper can send alerts of when a file server is over a certain size??
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
Question was received via mail as well. This is our answer:

You can do this with a custom report. In order to generate an alert on the hard-disk size of a file server, you need to check which asset type your file server has. The following report lists Windows assets with more than 500GB occupied space on any disk:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tblAssets.Lastseen,
tDiskspace.diskdrive,
tDiskspace.[used space (GB)]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblDiskdrives.AssetID,
tblDiskdrives.Caption As diskdrive,
Cast(Cast(tblDiskdrives.Size - tblDiskdrives.Freespace As bigint) / 1024 /
1024 / 1024 As numeric) As [used space (GB)]
From tblDiskdrives
Where tblDiskdrives.DriveType = 3) tDiskspace On tDiskspace.AssetID =
tblAssets.AssetID
Where tDiskspace.[used space (GB)] > 500 And tblAssetCustom.State = 1
Order By tblAssets.AssetName,
tDiskspace.diskdrive


The following report lists the same for Linux/Unix computers/devices:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tblAssets.Lastseen,
tDiskspace.Filesystem,
tDiskspace.[used space (GB)]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblLinuxHardDisks.AssetID,
tblLinuxHardDisks.Filesystem,
Cast(Case
When tblLinuxHardDisks.Used Like '%G' Then
Cast(Replace(Replace(tblLinuxHardDisks.Used, ',', '.'), 'G', '') As float)
When tblLinuxHardDisks.Used Like '%M' Then
Cast(Replace(Replace(tblLinuxHardDisks.Used, ',', '.'), 'M',
'') As float) / 1024
When tblLinuxHardDisks.Used Like '%K' Then
Cast(Replace(Replace(tblLinuxHardDisks.Used, ',', '.'), 'K',
'') As float) / 1024 / 1024
Else Cast(Replace(tblLinuxHardDisks.Used, ',', '.') As float)
End As decimal(25,3)) As [used space (GB)]
From tblLinuxHardDisks) tDiskspace On tDiskspace.AssetID = tblAssets.AssetID
Where tDiskspace.[used space (GB)] > 500 And tblAssetCustom.State = 1
Order By tblAssets.AssetName,
tDiskspace.Filesystem


Instructions for running reports can be found here. If you are interested in building or modifying reports, we would recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Updating to Lansweeper 5.3, if you haven't already. Lansweeper 5.3 includes a database dictionary, which is linked at the top of the report builder. The dictionary explains in great detail what each table and field stores.

View solution in original post

1 REPLY 1
Daniel_B
Lansweeper Alumni
Question was received via mail as well. This is our answer:

You can do this with a custom report. In order to generate an alert on the hard-disk size of a file server, you need to check which asset type your file server has. The following report lists Windows assets with more than 500GB occupied space on any disk:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tblAssets.Lastseen,
tDiskspace.diskdrive,
tDiskspace.[used space (GB)]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblDiskdrives.AssetID,
tblDiskdrives.Caption As diskdrive,
Cast(Cast(tblDiskdrives.Size - tblDiskdrives.Freespace As bigint) / 1024 /
1024 / 1024 As numeric) As [used space (GB)]
From tblDiskdrives
Where tblDiskdrives.DriveType = 3) tDiskspace On tDiskspace.AssetID =
tblAssets.AssetID
Where tDiskspace.[used space (GB)] > 500 And tblAssetCustom.State = 1
Order By tblAssets.AssetName,
tDiskspace.diskdrive


The following report lists the same for Linux/Unix computers/devices:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.IPAddress,
tblAssets.Lastseen,
tDiskspace.Filesystem,
tDiskspace.[used space (GB)]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select tblLinuxHardDisks.AssetID,
tblLinuxHardDisks.Filesystem,
Cast(Case
When tblLinuxHardDisks.Used Like '%G' Then
Cast(Replace(Replace(tblLinuxHardDisks.Used, ',', '.'), 'G', '') As float)
When tblLinuxHardDisks.Used Like '%M' Then
Cast(Replace(Replace(tblLinuxHardDisks.Used, ',', '.'), 'M',
'') As float) / 1024
When tblLinuxHardDisks.Used Like '%K' Then
Cast(Replace(Replace(tblLinuxHardDisks.Used, ',', '.'), 'K',
'') As float) / 1024 / 1024
Else Cast(Replace(tblLinuxHardDisks.Used, ',', '.') As float)
End As decimal(25,3)) As [used space (GB)]
From tblLinuxHardDisks) tDiskspace On tDiskspace.AssetID = tblAssets.AssetID
Where tDiskspace.[used space (GB)] > 500 And tblAssetCustom.State = 1
Order By tblAssets.AssetName,
tDiskspace.Filesystem


Instructions for running reports can be found here. If you are interested in building or modifying reports, we would recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Updating to Lansweeper 5.3, if you haven't already. Lansweeper 5.3 includes a database dictionary, which is linked at the top of the report builder. The dictionary explains in great detail what each table and field stores.