Fix quote symbole

master
Heuzef 5 years ago
parent 83117acb37
commit ec87150122
  1. 10
      zabbix.pl

@ -1,5 +1,5 @@
#!/usr/bin/perl #!/usr/bin/perl
use lib /usr/share/BackupPC/lib; use lib "/usr/share/BackupPC/lib";
use BackupPC::Lib; use BackupPC::Lib;
use BackupPC::CGI::Lib; use BackupPC::CGI::Lib;
use POSIX; use POSIX;
@ -26,7 +26,7 @@ my $lastXferErrors = 0;
my $maxErrors = 0; my $maxErrors = 0;
for ( my $i = 0 ; $i < @backups ; $i++ ) { for ( my $i = 0 ; $i < @backups ; $i++ ) {
if ( $backups[$i]{type} eq full ) { if ( $backups[$i]{type} eq "full" ) {
$fullCnt++; $fullCnt++;
if ( $fullAge < 0 || $backups[$i]{startTime} > $fullAge ) { if ( $fullAge < 0 || $backups[$i]{startTime} > $fullAge ) {
$fullAge = $backups[$i]{startTime}; $fullAge = $backups[$i]{startTime};
@ -49,10 +49,10 @@ else {
$lastAge = $incrAge; $lastAge = $incrAge;
} }
if ( $lastAge < 0 ) { if ( $lastAge < 0 ) {
$lastAge = ; $lastAge = "";
} }
else { else {
$lastAge = sprintf(%.1f, (time - $lastAge) / (24 * 3600)); $lastAge = sprintf("%.1f", (time - $lastAge) / (24 * 3600));
} }
$lastXferErrors = $backups[@backups-1]{xferErrs} if ( @backups ); $lastXferErrors = $backups[@backups-1]{xferErrs} if ( @backups );
$maxErrors = $conf->{MaxXferError} if (defined $conf->{MaxXferError}); $maxErrors = $conf->{MaxXferError} if (defined $conf->{MaxXferError});
@ -75,7 +75,7 @@ elsif ($what eq ‘notify’){
print $conf->{EMailNotifyOldBackupDays}; print $conf->{EMailNotifyOldBackupDays};
} }
else{ else{
print<<EOF; print<<"EOF";
Usage: $0 <host> [errors|age|size|duration] Usage: $0 <host> [errors|age|size|duration]
EOF EOF

Loading…
Cancel
Save