Windows NRPE

check_folder_size.vbs

Description:

I had problem with script check_filesize.vbs so I writed easy script for size folder

Current Version

1.0

Last Release Date

2010-03-18

Compatible With

  • Nagios 3.x

Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
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) Add a Review
"Cint" Error Execution
by Hasyame, July 31, 2016
Really good script!
But I have one problem: A error appear :
" NSClient++scriptscheck_folder_size.vbs(36, 3) Execution Error Microsoft VBScript: 'Cint' "

Anyone have a solution for this?
Helpful? Yes  No 
Fix
by pintxoj, June 30, 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
Helpful? Yes  No 
critical and warning levels
by AcheronAcis, July 31, 2015
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
Helpful? Yes  No 
Arguments
by williama, May 31, 2015
great script. Just wondering how to get this to work with arguments?
Helpful? Yes  No 
In reply to adarsh
by jlovegrove, January 31, 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.
Helpful? Yes  No 
missed somethin
by adarsh, May 31, 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 :)
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.5 (6)
Favorites
1
Views
160,577