Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
Here is a little fix to this plugin. First fixed the Warinig and Critical alarms (thanks for the comment), and then added a basic perfdata (only the size in MB no critical and warning value)
Dim strfolder Dim intwarning Dim intcritic Dim wsh Dim intvelkost Dim intjednotka Dim Perf_Data ‘##########################################################’ Set objFSO = CreateObject(“Scripting.FileSystemObject”) Set wsh = CreateObject(“WScript.Shell”) ‘##########################################################’ If Wscript.Arguments.Count = 3 Then strfolder = Wscript.Arguments(0) intwarning = Wscript.Arguments(1) intcritic = Wscript.Arguments(2)
Set objFolder = objFSO.GetFolder(strfolder) intjednotka = 1048576 ‘1MB->bytes’ intvelkost = objFolder.Size/intjednotka Perf_Data = “|’FolderSize’=” & round (objFolder.Size / 1048576,1) & “MB;”
if (objFolder.Size/1024000) > Cint(intcritic) then Wscript.Echo “CRITICAL:” & round (objFolder.Size / 1048576,1) & ” MB” & Perf_Data Wscript.Quit(2) elseif (objFolder.Size/1048576) > Cint(intwarning) then Wscript.Echo “WARNING:” & round (objFolder.Size / 1048576,1) & ” MB” & Perf_Data Wscript.Quit(1) else Wscript.Echo “OK:” & round (objFolder.Size /1048576,1) & ” MB” & Perf_Data Wscript.Quit(0) end if
else Wscript.Echo “UNKNOWN:”& strfolder &”-” & intwarning & “-” & intcritic Wscript.Quit(3) End If