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

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 12 years ago
parent e7cf5f74cd
commit 59adef4377
  1. 2
      conf/backuppc.conf
  2. 6
      scripts/check_backuppc_sudo

@ -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

@ -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";

Loading…
Cancel
Save