Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_MostRecentFile
It's useful for monitoring incremental log files with names that change with the dates.
Output values: 0=OK, 1=Warning, 2=critical, 3=unknown
This script can be useful for monitoring application log file names that change with the date. For example, I often want to check if a process is still generating a log file (and that the file is not empty).
Intended for use with Nagios check_nrpe / nsclient++.
It accepts four arguments:
- directory path
- warning age (in minutes)
- critical age (in minutes)
- minimum file size (in bytes)
sample command line execution:
cscript check_MostRecentFile.vbs c:testdir 1440 2880 10
NOTE: Files with the "hidden" attribute are intentionally excluded by the script, but this can be easily changed if needed.
This script can be useful for monitoring application log file names that change with the date. For example, I often want to check if a process is still generating a log file (and that the file is not empty).
Intended for use with Nagios check_nrpe / nsclient++.
It accepts four arguments:
- directory path
- warning age (in minutes)
- critical age (in minutes)
- minimum file size (in bytes)
sample command line execution:
cscript check_MostRecentFile.vbs c:testdir 1440 2880 10
NOTE: Files with the "hidden" attribute are intentionally excluded by the script, but this can be easily changed if needed.
Reviews (2)
byjlovegrove, December 1, 2014
@peakyblinder - I believe you have to use short paths.
You can find out the short path of a directory by CMD>DIR /X
DIR /X gives you the short file name for each file/folder.
Example: C:PROGRA~1MICROS~3 is a short path to Program FilesMicrosoft SQL.
You can find out the short path of a directory by CMD>DIR /X
DIR /X gives you the short file name for each file/folder.
Example: C:PROGRA~1MICROS~3 is a short path to Program FilesMicrosoft SQL.
bypeakyblinder, April 6, 2014
This works great except when you want to use spaces in your directory paths.
If you know of a workaround or how to specify the command it would be a great help.
Thanks,
If you know of a workaround or how to specify the command it would be a great help.
Thanks,