[Nagiosplug-help] (no subject)
Bill Lopez
bill_k_lopez at yahoo.com
Fri May 14 16:43:10 CEST 2010
I have a vb script that checks mounted disk size and pukes out the numbers (all included below)
how does nagios know to show warning and critical?
how do I get nagios to understand what values should be used for WARNING and CRITICAL ?
here is the vb script
---------------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_MappedLogicalDisk Where Name = 'F:' ")
For Each objItem in colItems
disk_total=objItem.Size/(1024*1024*1024)
disk_used=(objItem.Size-objItem.FreeSpace)/(1024*1024*1024)
disk_used_perc=disk_used/disk_total
disk_free=objItem.FreeSpace/(1024*1024*1024)
disk_free_perc=disk_free/disk_total
Wscript.Echo objItem.ProviderName & "- total: " & Round(disk_total, 2) & " Gb" & " - used: " & Round(disk_used, 2) & " Gb" & " (" & Round(disk_used_perc*100) & "%)" & " - free: " & Round(disk_free, 2) & " Gb" & " (" & Round(disk_free_perc*100) & "%)"
Next
---------------
text output from the script is
\\servername\FS300- total: 246.19 Gb - used: 110.13 Gb (45%) - free: 136.05 Gb (55%)
nagios display shows
DISKSPACE FS301 OK 05-13-2010 20:50:05 0d 3h 30m 42s 1/4 \essnas1FS301- total: 246.19 Gb - used: 207.88 Gb (84%) - free: 38.3 Gb (16%)
More information about the Help
mailing list