Page 1 of 1

can robo taaask do...

Posted: Mon Apr 06, 2009 10:20 am
by mosler
Check disk space for multiple machinesGenerate disk usage reportsCan be scheduledCan be triggered when usage hits a certain thresholdCan email reports

can robo taaask do...

Posted: Tue Apr 07, 2009 4:03 am
by Oleg
Check disk space for multiple machines
Generate disk usage reports
Yes. Maybe we need to add such system variables. But now you can do this with basic script.
See basic script below.

Code: Select all

Public Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As Long

Sub Main
Dim sec As Long
Dim bps As Long
Dim fc As Long
Dim tc As Long
Dim res As Double

GetDiskFreeSpace("c:\", sec, bps, fc, tc)

res = CDbl(sec)*CDbl(bps)*CDbl(fc)
MsgBox("Free bytes " + CStr(res) +" bytes")

res = CDbl(sec)*CDbl(bps)*CDbl(tc)
MsgBox("Total bytes " + CStr(res) +" bytes")

res = (fc/tc)*100
MsgBox("Disk load " + CStr(res) +" %")

End Sub
Use UNC names for network disks: \\computer2\share\
Can be scheduled
Yes. You may attach to task scheduler triggering event.
Can be triggered when usage hits a certain threshold
Attach the cyclic event to the task.
Algorithm of the task will be such:

calculate DiskLoad
if DiskLoad > limit then
   create text of report
   mail report
end if
Can email reports
Yes. See "Send email" action