diff --git a/backuppc_check.pl b/backuppc_check.pl index 0c3d0e1..19ba24a 100644 --- a/backuppc_check.pl +++ b/backuppc_check.pl @@ -32,14 +32,12 @@ if ( $host ) { my $age = -1; $json = { bkp => 0, - full_size => 0, errors => 0, new_size => 0, new_size_avg => 0, new_size_median => 0, new_size_q1 => 0, - new_size_q3 => 0, - comp_ratio => 0 + new_size_q3 => 0 }; my $lastXferErrors = 0; @@ -72,10 +70,8 @@ if ( $host ) { # Some old versions of Statistics::Descriptive (eg, on el5) do not support quantile $json->{new_size_q1} = eval { int $sizes->quantile(1) } || 0; $json->{new_size_q3} = eval { int $sizes->quantile(3) } || 0; - $json->{enabled} = ( $conf->{BackupsDisable} > 0 ) ? 0 : 1; - $json->{total_size} = $sizes->sum + $json->{full_size} - 2 * $new_size_of_last_full; $json->{age} = time - $bpc_info[$i]->{startTime}; - $lastAge = sprintf("%.1f", ($json->{age}) / 84600); + $json->{lastAge} = sprintf("%.1f", ($json->{age}) / 84600); $json->{max_errors} = $conf->{MaxXferError} || 0; } } @@ -90,7 +86,7 @@ EOF # Print results print("\n----------------\n"); -print("Last Backup : $lastAge"); +print("Last Backup : $json->{$lastAge}"); print("\n"); print("Errors : $json->{errors}"); print("\n");