Build precise queries to find exactly what you need
Press ESC to close
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
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!