Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check File Size
Nagio/NRPE_NT VBS Script to check the size of file(s) inside a Folder.
Usage:
check_filesize -p "path" -f "file(s)" -w -c
Example:
check_filesize -p "E:mdbdata" -f priv1.edb,priv1.stm,pub1.edb,pub1.stm -w 5000 -c 10000
Sample Output:
STATUS OK - priv1.edb = 21.690,00(MB) - priv1.stm = 13.680,00(MB) - pub1.edb = 735,00(MB) - pub1.stm = 6,00(MB)
It accepts multiple file checks, the Warning/Critical thresholds (-w,-c) should be passed in Megabytes.
The alarm will be raised if any files reach the threshold.
Also the path can be in UNIX format or Windows format / the script will accept both.
EASY HOWTO:
1-Place the script
Copy the script to "c:nrpe_ntpluginsv2" or whatever location your NRPE_NT .vbs are at.
2-Set nrpe_nt.cfg
Inside the NRPE_NT Client Server add the command line in the file nrpe_nt.cfg:
command[check_filesize]=cscript.exe //nologo //T:60 c:nrpe_ntpluginsv2check_filesize.vbs -p "$ARG1$" -f "$ARG2$" -w "$ARG3$" -c "$ARG4$"
3-Restart the nrpe_nt service
net stop nrpe_nt
net start nrpe_nt
4-Define the command inside nagios
$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_filesize -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
Direct Download here
http://www.xoroz.com/files/scripts/nagios/check_filesize.vbs
Usage:
check_filesize -p "path" -f "file(s)" -w -c
Example:
check_filesize -p "E:mdbdata" -f priv1.edb,priv1.stm,pub1.edb,pub1.stm -w 5000 -c 10000
Sample Output:
STATUS OK - priv1.edb = 21.690,00(MB) - priv1.stm = 13.680,00(MB) - pub1.edb = 735,00(MB) - pub1.stm = 6,00(MB)
It accepts multiple file checks, the Warning/Critical thresholds (-w,-c) should be passed in Megabytes.
The alarm will be raised if any files reach the threshold.
Also the path can be in UNIX format or Windows format / the script will accept both.
EASY HOWTO:
1-Place the script
Copy the script to "c:nrpe_ntpluginsv2" or whatever location your NRPE_NT .vbs are at.
2-Set nrpe_nt.cfg
Inside the NRPE_NT Client Server add the command line in the file nrpe_nt.cfg:
command[check_filesize]=cscript.exe //nologo //T:60 c:nrpe_ntpluginsv2check_filesize.vbs -p "$ARG1$" -f "$ARG2$" -w "$ARG3$" -c "$ARG4$"
3-Restart the nrpe_nt service
net stop nrpe_nt
net start nrpe_nt
4-Define the command inside nagios
$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_filesize -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
Direct Download here
http://www.xoroz.com/files/scripts/nagios/check_filesize.vbs
Reviews (0)
Be the first to review this listing!