NAME
Monitoring::Sneck::Checks::file_age - checks how old and how big a file is
VERSION
Version 0.0.1
SYNOPSIS
backup_age|perl:file_age -f /var/backups/db.sql.gz -w 90000 -c 180000 -W 1024:
heartbeat|perl:file_age -f /var/run/app.heartbeat -w 60 -c 300
nightly_dump|perl:file_age -n '/var/backups/db-*.sql.gz' -w 90000 -c 180000 -W 1024:
DESCRIPTION
Checks the age of a file, from when it was last changed, and its size. A file that is not there is CRITICAL, unless --ignore-missing is given.
With --newest, the file is the most recently changed one matching a glob, for files named by date, such as backups. Nothing matching is the same as a file not being there.
As ranges, a plain number such as 240 is over 240 seconds, and 1024: is under 1024 bytes.
OPTIONS
- -f, --file :: The file.
- -n, --newest :: A glob, the newest file matching it being checked, in place of --file.
- -w, --warning :: Range of seconds for the age. Default :: 240
- -c, --critical :: Range of seconds for the age. Default :: 600
- -W, --size-warning :: Range of bytes for the size.
- -C, --size-critical :: Range of bytes for the size.
- -i, --ignore-missing :: A missing file is OK.
One of --file or --newest must be given.
METHODS
check
Does the check.