Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_folder_size.vbs
1.0
2010-03-18
- Nagios 3.x
160707
File | Description |
---|---|
check_folder_size.vbs | check_folder_size.vbs |
check_folder_size.txt | check_folder_size.txt |
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!
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
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)
byHasyame, July 27, 2016
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?
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?
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
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
byAcheronAcis, July 30, 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
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
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 :)
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 :)