Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_folder_size.vbs

Current Version
1.0
Last Release Date
2010-03-18
Compatible With
  • Nagios 3.x
Owner
Hits
160042
Files:
FileDescription
check_folder_size.vbscheck_folder_size.vbs
check_folder_size.txtcheck_folder_size.txt
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
I had problem with script check_filesize.vbs so I writed easy script for size folder
Create Marek Pastier 18.03.2010
Easy script for check space folder. You need NRPE_NT daemon on win computer
##########################################################
Install
##########################################################
1.copy file to c: for example... c:nrpe_ntbincheck_folder_size.vbs
2.set your nrpe.cfg for command for example
command[check_foldersize]=c:windowssystem32cscript.exe //NoLogo //T:30 c:nrpe_ntbincheck_folder_size.vbs c:yourfolder 50 78
50 70 are parameters for warning and critical value in MB
3.restart your nrpe_nt daemon in command prompt example.. net stop nrpe_nt and net start nrpe_nt
4. try from linux example.: ./check_nrpe -H yourcomputer -c check_foldersize and result can be OK:22,8 MB
it is all
Reviews (6)
Really good script!
But I have one problem: A error appear :
" NSClient++\scripts\check_folder_size.vbs(36, 3) Execution Error Microsoft VBScript: 'Cint' "

Anyone have a solution for this?
bypintxoj, June 28, 2016
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
great script,
but script never gives critical cause when a folder comes above warning level, it gives a warning and then wscript.quit
if you reverse the warning en critical lines in the script it works as expected
bywilliama, May 10, 2015
great script. Just wondering how to get this to work with arguments?
byjlovegrove, January 5, 2015
For some odd reason, slashes on this website don't work well in reviews and submissions! - See the text file of this plugin for the correct path names.
byadarsh, May 6, 2013
hi,
thanks. but it seems you are missing slashes in the path. please try with slash and it will work
anyway this plugin is great it is used to monitor my servers share folder sizes :)