Update df_percent (windows agent plugin)

This commit is contained in:
fbsanchez 2017-02-03 12:41:47 +01:00
parent 25f734c3bc
commit 047f7de972
1 changed files with 13 additions and 14 deletions

View File

@ -25,25 +25,24 @@ For Each objItem in colItems
If argc = 0 Or argv.Exists(objItem.Name) Then
' Include only harddrivers (type 3)
If (objItem.FreeSpace <> "") AND (objItem.DriveType =3) Then
Percent = round ((objItem.FreeSpace / objItem.Size) * 100, 2)
Percent = round ((objItem.FreeSpace / objItem.Size) * 100, 2)
Wscript.StdOut.WriteLine "<module>"
Wscript.StdOut.WriteLine " <name><![CDATA[DiskFree%_" & objItem.Name & "]]></name>"
Wscript.StdOut.WriteLine " <description><![CDATA[Drive " & objItem.Name & " % free space ]]></description>"
If (Percent > 99.99) then
Wscript.StdOut.WriteLine " <description><![CDATA[Drive " & objItem.Name & " free space: " & Int(objItem.FreeSpace /1048576) & " MB]]></description>"
If (Percent > 99.99) then
Wscript.StdOut.WriteLine " <data><![CDATA[" & 100 & "]]></data>"
Elseif (Percent < 0.01) then
Elseif (Percent < 0.01) then
Wscript.StdOut.WriteLine " <data><![CDATA[" & 0 & "]]></data>"
Else
Else
Wscript.StdOut.WriteLine " <data><![CDATA[" & Percent & "]]></data>"
End If
Wscript.StdOut.WriteLine "<unit>%</unit>"
Wscript.StdOut.WriteLine "<min_warning>5</min_warning>"
Wscript.StdOut.WriteLine "<max_warning>10</max_warning>"
Wscript.StdOut.WriteLine "<min_critical>0</min_critical>"
Wscript.StdOut.WriteLine "<max_critical>5</max_critical>"
Wscript.StdOut.WriteLine "</module>"
Wscript.StdOut.flush
End If
Wscript.StdOut.WriteLine " <unit>%</unit>"
Wscript.StdOut.WriteLine " <min_warning>5</min_warning>"
Wscript.StdOut.WriteLine " <max_warning>10</max_warning>"
Wscript.StdOut.WriteLine " <min_critical>0</min_critical>"
Wscript.StdOut.WriteLine " <max_critical>5</max_critical>"
Wscript.StdOut.WriteLine "</module>"
Wscript.StdOut.flush
End If
End If
Next