check_filesize_dir
Perl script to get the number of files in a directory listing and return a Warning or Critical state if the count exceeds the threshold. Script hacked from the check_filesize_dir.pl by Christian Reiter
Check number of Files in a Directory Useful for Mailboxes, AV, mail queue and similar files.
Synopsis
| Flag | Description |
|---|---|
| -d < DIRECTORY > | the Directory to check (example: /var/spool/mail) |
| -c < CRITICAL > | Critical threshold in file count (example: 100) |
| -w < WARNING > | Warning threshold in file count (example: 75) |
| -h | displays the Help message |
Usage:
./check_filesize_dir.pl -d -w -c
Example:
./check_filesize_dir.pl -d /var/spool/mail -w 75 -c 100