Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Counts the number of files in given directory and its sub-directories, with optional filters applied. The output is compatible with Nagios.
Current Version
Last Release Date
February 4, 2010
Owner
71381
Script Name : check_files.vbs Usage Syntax : cscript.exe //NoLogo check_filecount.vbs -p <path> [-r] [-f <filter>] -w <warn> -c <crit> | -h Author : Alex Simenduev, PlanetIT (http://www.planetit.ws) Version : 2009.11.1 LastModified : 1/11/2009 Description : Counts the number of files in given directory and its subdirectories, with optional filters applied. The output is compatible with Nagios. Default Exit code is 3 (UNKNOWN)
Examples: cscript.exe //NoLogo check_files.vbs -p C:WindowsTemp -w 100 -c 200 Count files in C:WindowsTemp, return WARNING if number of files more than 100 and CRITICAL if more than 200.
cscript.exe //NoLogo check_files.vbs -p D:Files -f "Size:>1024*1024" -w 5 -c 20 Count files in D:Files, and look only for files that are bigger than 1MB, return WARNING if number of files more than 5 and CRITICAL if more than 20.
cscript.exe //NoLogo check_files.vbs -p D:Logs -f "AgeCreated:>7*60*60*24" -f "RegEx:.*.log$" -w 5 -c 5 Count files in D:Logs, and look only for log (*.log) files that are created at least 7 days ago, return CRITICAL if more than 5 was found.
cscript.exe //NoLogo check_files.vbs -p C:Windows -r -f "RegEx:.*.tmp$" -w 20 -c 50 Count files in C:Windows and its subdirectories, and look only for tmp (*.tmp) files, return WARNING if number of files more than 20 and CRITICAL if more than 50 was found.
License: - This script is supplied as-is without any support, I hope it works for you. - You free to modify/distribute this script as you wish, but you must have the following line in the script: Original author Alex Simenduev, PlanetIT (http://www.planetit.ws)
Change Log: Legend: [*] Informational, [!] Bugix, [+] Added, [-] Removed
Version 2009.11.1: [!] More accurate argument parsing, will fix some small bugs. [!] Fixed bug in RegEx filter if in pattern a ':' sign was specified. [+] Added check for invalid filter type, script will exit with error printed. [+] Added check for invalid filter value, script will exit with error printed. [+] Added examples to the help screen. [*] Recursive check is optional now, use '-r' option to turn it on.
Version 2009.10.29: [!] More accurate check for the '--path' argument, added message.
Version 2009.10.28: [*] Initial release.
Hi, My name is Alex Simenduev, my NagiosExchange username is shamil. I'm the author of that plugin. I want to be the owner of current listing. How can I achieve that? Thank Alex Simenduev http://www.planetit.ws
You must be logged in to submit a review.
To:
From: