Support an item which returns the period without backups before triggering a mail alert

This commit is contained in:
Daniel Berteaud 2013-04-14 20:46:24 +02:00
parent e7cf5f74cd
commit 59adef4377
2 changed files with 7 additions and 1 deletions

View File

@ -9,5 +9,5 @@ UserParameter=backuppc.host.discovery,/usr/bin/sudo /var/lib/zabbix/bin/disco_ba
# Item prototypes
# key: backuppc.host.info[{#BPCHOST},item]
# Valide item are: errors, size, duration, age
# Valide item are: errors, size, duration, age, notify
UserParameter=backuppc.host.info[*],/usr/bin/sudo /var/lib/zabbix/bin/check_backuppc_sudo $1 $2

View File

@ -18,6 +18,9 @@ my $what = $ARGV[1];
my $bpc = BackupPC::Lib->new();
my @backups = $bpc->BackupInfoRead($host);
my $mainConf = $bpc->ConfigDataRead();
my $hostConf = $bpc->ConfigDataRead($host);
my $conf = { %$mainConf, %$hostConf };
my $fullCnt = $incrCnt = 0;
my $fullAge = $incrAge = $lastAge = -1;
my $lastXferErrors = 0;
@ -64,6 +67,9 @@ elsif ($what eq 'size'){
elsif ($what eq 'duration'){
print $fullDur;
}
elsif ($what eq 'notify'){
print $conf->{EMailNotifyOldBackupDays};
}
else{
print<<"EOF";