Replace json entry last_age

master
Heuzef 5 years ago
parent 8a661dbc83
commit aedf147a2e
  1. 5
      backuppc_check.pl

@ -31,6 +31,7 @@ if ( $host ) {
my $age = -1; my $age = -1;
$json = { $json = {
bkp => 0, bkp => 0,
last_age => 0,
errors => 0, errors => 0,
new_size => 0, new_size => 0,
new_size_avg => 0, new_size_avg => 0,
@ -70,7 +71,7 @@ if ( $host ) {
$json->{new_size_q1} = eval { int $sizes->quantile(1) } || 0; $json->{new_size_q1} = eval { int $sizes->quantile(1) } || 0;
$json->{new_size_q3} = eval { int $sizes->quantile(3) } || 0; $json->{new_size_q3} = eval { int $sizes->quantile(3) } || 0;
$json->{age} = time - $bpc_info[$i]->{startTime}; $json->{age} = time - $bpc_info[$i]->{startTime};
$json->{lastAge} = sprintf("%.1f", ($json->{age}) / 84600); $json->{last_age} = sprintf("%.1f", ($json->{age}) / 84600);
$json->{max_errors} = $conf->{MaxXferError} || 0; $json->{max_errors} = $conf->{MaxXferError} || 0;
} }
} }
@ -85,7 +86,7 @@ EOF
# Print results # Print results
print("\n----------------\n"); print("\n----------------\n");
print("Last Backup : $json->{$lastAge}"); print("Last Backup : $json->{$last_age}");
print("\n"); print("\n");
print("Errors : $json->{errors}"); print("Errors : $json->{errors}");
print("\n"); print("\n");

Loading…
Cancel
Save