Home Directory Plugins Operating Systems Windows check_files.vbs - external script to be used with nsclient

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


Remember Me

Directory Tree

check_files.vbs - external script to be used with nsclient

Current Version
Last Release Date
Compatible With
  • Nagios 3.x
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Check files under a given path against various criteria:
namefilter, age, size

counts the files which match the given criterias and gives alarm if the count is higher or lower than the threshold
(bounds definition conforms to nagios plugin guidelines)
check files under a given path

uses NagiosPlugin.vbs from nsclient++/scripts/lib
- NagiosPlugin.vbs which came with nsclient++ vers. 0.3.9 (earlier version needed adaptation)
- compares bounds to double values, so 10 comes after 9 (numeric sorting)
- bounds definition conforms to nagios plugin guidelines (http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT)

warning: threshold warning
alert if x...
10 < 0 or > 10, (outside the range {0..10})
10: < 10, (outside {10 .. 8})
~:10 > 10, (outside the range of {-8 .. 10})
10:20 < 10 or > 20, (outside the range {10..20})
@10:20 >= 10 and <= 20, (inside the range {10..20})
critical: threshold critical
namefilter: regular expressionon on which files have to match
age: files have to be older/newer (see selage) than age
e.g.: 5d: 5 days, 4h: 4 hours, 10n: 10 Minutes, 90s: 90 seconds
selage: older/newer/hour/ignore
older/newer: count only files if the are older/newer
hour: alert if file is not written until hour
ignore: count files independent of their age
searchdepth: search down x subdirs (searchdepth:1 - do not go down in directory hierarchy)
seldat: modified/created
modified: date, when file was written
created: date, when file was created
size: if file is smaller than given size give a warning
expectmatch: if less than expectmatch files correspond to namefilter give a warning
if selage:hour files have to be written only on weekdays (1:sunday, 2:monday, ...)
if selage:newer or selage:older and the timeunit of age is d (days), we add as many days to age as the last weekday is back
e.g.: weekdays:23456 files are written on Monday, Tuesday, Wednesday, Thursday, Friday