aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Beaupré <anarcat@koumbit.org>2015-04-17 17:31:19 -0400
committerAntoine Beaupré <anarcat@koumbit.org>2015-04-17 17:31:19 -0400
commit795769c39b21be36235b1cc86a17b104ce4afdff (patch)
tree60ce685a2da540cd33dfde8e05654d00eeffb968
parentb1ad64a1bc8bd867f327f9f6563665d855f6bb89 (diff)
downloadpuppet-backupninja-795769c39b21be36235b1cc86a17b104ce4afdff.tar.gz
puppet-backupninja-795769c39b21be36235b1cc86a17b104ce4afdff.tar.bz2
show time delay in hours
-rwxr-xr-xfiles/checkbackups.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/files/checkbackups.pl b/files/checkbackups.pl
index 82387ea..f617297 100755
--- a/files/checkbackups.pl
+++ b/files/checkbackups.pl
@@ -82,7 +82,7 @@ sub check_rdiff {
else {
$service = 'backups';
}
- print_status($host, $state, "$delta seconds old$extra_msg", $service);
+ print_status($host, $state, "$delta hours old$extra_msg", $service);
foreach my $vserver_dir (@vserver_dirs) {
$vsdir = "$dir/$vserver_dir";
if (opendir(DIR, $vsdir)) {
@@ -96,7 +96,7 @@ sub check_rdiff {
my @dom_sufx = split(/\./, $host);
my $dom_sufx = join('.', @dom_sufx[1,-1]);
foreach my $vserver (@vservers) {
- print_status("$vserver.$dom_sufx", $state, "$delta seconds old$extra_msg, same as parent: $host");
+ print_status("$vserver.$dom_sufx", $state, "$delta hours old$extra_msg, same as parent: $host");
}
}
@@ -111,6 +111,7 @@ sub check_age {
} elsif ($delta >= 0) {
$state = $STATE_OK;
}
+ $delta = sprintf '%.2f', $delta/3600.0;
return ($state, $delta);
}
@@ -130,7 +131,7 @@ sub check_flag {
}
else {
($state, $delta) = check_age($stats[9]);
- print_status($host, $state, "$delta seconds old");
+ print_status($host, $state, "$delta hours old");
}
}