cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MikeInLa
Champion Sweeper
I would like to receive an email when one of the drives on my exchange server is 90% full. I have setup emailing in lansweeper and tested by emailing a small report. I would like my exchange server to be checked twice a day or more and if a drive size is over the 90% mark during that scan, it will alert me immediately by email. Can someone help me out with the best way to accomplish this? Thanks in advance!
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
A sample report can be seen below. Replace the 90 (= 90 percent) marked in bold with a percentage of your choice. The report will return any disks that are more than 90% full.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname,
tblAssets.Description,
tblDiskdrives.Caption,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
free,
Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) As
[total size],
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) As UsedPCT,
tblDiskdrives.Lastchanged As [last changed],
tsysOS.Image As icon
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) <> 0 And
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) > 90 And tblDiskdrives.DriveType = 3 And tblAssetCustom.State = 1

View solution in original post

10 REPLIES 10
Hemoco
Lansweeper Alumni
It's just a matter of adding a criterion to the Criteria column of the appropriate expression. E.g. if you wanted to report on computer "LAN-001", you'd add the AssetName field of tblAssets to your report (double-click on table and tick field) and add the below to the Criteria column. This at least is very logical and other SQL basics can be learned fairly quickly and easily as well.
= 'LAN-001'

We really think it's worthwhile to spend some time learning SQL or just exploring the report builder. It'll make it easy for you to modify and possibly build reports to your liking.
MikeInLa
Champion Sweeper
With respect, SQL queries are not my strong point, and being a support tech as well, I just don't have time to mess with it. We actually have guys here that do that but they don't work in my department and would probably frown if I asked them for help with this.
I appreciate your help, it works flawlessly!
Thanks...
MikeInLa
Champion Sweeper
Sorry, this is working great for us... but was just wondering if possible to only show C drives? Looking at the way this all works, it doesn't seem possible, just thought I would ask. Thanks again for the report 🙂
Hemoco
Lansweeper Alumni
MikeInLa wrote:
Sorry, this is working great for us... but was just wondering if possible to only show C drives? Looking at the way this all works, it doesn't seem possible, just thought I would ask. Thanks again for the report 🙂

Use the report below for this. For future reporting, we would recommend reviewing some SQL tutorials, as the Lansweeper report builder uses standard SQL queries and adding criteria is a basic SQL thing. This seems like a good tutorial: http://www.w3schools.com/sql/default.asp?PHPSESSID=300ae3404d5fa2612f238abeebb8869c
SELECT TOP (1000000) tblAssets.AssetID, tblAssets.AssetUnique, tsysOS.OSname, tblAssets.Description, tblDiskdrives.Caption, CAST(CAST(tblDiskdrives.Freespace AS bigint)
/ 1024 / 1024 AS numeric) AS free, CAST(CAST(tblDiskdrives.Size AS bigint) / 1024 / 1024 AS numeric) AS [total size],
CEILING((tblDiskdrives.Size - tblDiskdrives.Freespace) / (CASE tblDiskdrives.Size WHEN 0 THEN 1 ELSE tblDiskdrives.Size END) * 100) AS UsedPCT,
tblDiskdrives.Lastchanged AS [last changed], tsysOS.Image AS icon
FROM tblAssets INNER JOIN
tblDiskdrives ON tblAssets.AssetID = tblDiskdrives.AssetID INNER JOIN
tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID INNER JOIN
tsysOS ON tblAssets.OScode = tsysOS.OScode
WHERE (CAST(CAST(tblDiskdrives.Size AS bigint) / 1024 / 1024 AS numeric) <> 0) AND (CEILING((tblDiskdrives.Size - tblDiskdrives.Freespace)
/ (CASE tblDiskdrives.Size WHEN 0 THEN 1 ELSE tblDiskdrives.Size END) * 100) > 90) AND (tblDiskdrives.DriveType = 3) AND (tblAssetCustom.State = 1) AND
(tblDiskdrives.Caption LIKE N'%c%')
MikeInLa
Champion Sweeper
Perfect again... thank you for your time 🙂
Hemoco
Lansweeper Alumni
A sample report can be seen below. Replace the 90 (= 90 percent) marked in bold with a percentage of your choice. The report will return any disks that are more than 90% full.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname,
tblAssets.Description,
tblDiskdrives.Caption,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
free,
Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) As
[total size],
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) As UsedPCT,
tblDiskdrives.Lastchanged As [last changed],
tsysOS.Image As icon
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) <> 0 And
Ceiling((tblDiskdrives.Size - tblDiskdrives.Freespace) /
(Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size
End) * 100) > 90 And tblDiskdrives.DriveType = 3 And tblAssetCustom.State = 1
MikeInLa
Champion Sweeper
Is there a way to have this report only show those computers with drives over 90% used?
MikeInLa
Champion Sweeper
This is perfect. A daily report will be helpful. Although not really an alert (and I didn't think it could do it but thought I would ask anyway), it will help us stave off an issue on a server where a drive is getting dangerously full. We've been caught with our pants down a few times because of this.
Thanks again...
Hemoco
Lansweeper Alumni
Hi,

You cannot let Lansweeper send you a mail when the drives are 90% full. You can only let Lansweeper send you a report or when specific event occurs in the eventlog.
What you can do is let Lansweeper send you every day a report .
We have made a report for you to check which computer drives are 90%full.


You can use the report down here:
Select Top 1000000 tsysAssetTypes.AssetTypeIcon16 As icon,
tblAssets.AssetID,
tblAssets.AssetName As [Computer Name],
(Sum(tblDiskdrives.Size) - Sum(tblDiskdrives.Freespace)) /
(Sum(tblDiskdrives.Size) / 100) As [percent used]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Group By tsysAssetTypes.AssetTypeIcon16,
tblAssets.AssetID,
tblAssets.AssetName
Order By [Computer Name]

To use the report above, do the following:
• Open the report builder under Reports/Create New Report.
• Paste the SQL code we provided at the bottom of the page.
• Left-click somewhere in the upper section of the page so the code applies.
• Give the report a Title and hit the Save & Run button to save it. Export options are listed on the left.