working/random.git
10 years agoNagios/Icinga: Check existance of daily PostgreSQL backup file
Michael Peters [Wed, 5 Aug 2015 18:15:08 +0000 (14:15 -0400)]
Nagios/Icinga:  Check existance of daily PostgreSQL backup file

A Nagios plugin (also works with NRPE and Icinga) written in Perl
which checks for the existance of a daily PostgreSQL backup file.

To use, install to your nagios-plugins folder (usually /usr/lib/nagios/plugins)
and make sure the script has executable permissions by the nagios user.

This script will return one of three statuses to Nagios/Icinga;

OK - File does not exist, because it has not yet been created by cron.
OK - File exists.
CRITICAL File does not exist.

Follow the comments in the script to configure the first hour, on
a new day, that you want to begin checking for existance of the file.

A function is included so that you won't recieve a critical alert
when the clock hits 00:00 and no backup file exists because your
backup cron job has not yet run.

Signed-off-by: Michael Peters <mpeters@emeralddata.net>