NAME

Monitoring::Sneck::Checks::file_content - checks a file being there, or not, and what is in it

VERSION

Version 0.0.1

SYNOPSIS

hourly_logrotate|perl:file_content -f /etc/cron.hourly/logrotate -x -r /etc/logrotate\.conf
app_logrotate|perl:file_content -f /etc/logrotate.d/app
no_root_ssh|perl:file_content -f /etc/ssh/sshd_config -r '^PermitRootLogin\s+no'
no_nologin|perl:file_content -f /etc/nologin -A

DESCRIPTION

A file that is not there is CRITICAL, as is one missing a line for a --regex, or with one for a --not-regex. Lines matching --comment are skipped for both.

OPTIONS

- -f, --file :: The file. Required.

- -r, --regex :: A regex at least one line must match. May be given more than once.

- -R, --not-regex :: A regex no line may match. May be given more than once.

- -x, --executable :: It must be executable.

- -A, --absent :: It must not be there, in place of the others.

- -C, --comment :: A regex for lines to skip. Default :: ^\s*#

METHODS

check

Does the check.