diff --git a/ROOT/DEBIAN/control b/ROOT/DEBIAN/control index 7539d16c0f48a0f0bc77edcff9332c1542cda60c..a103d56c99a9b4dbeb1ab9a506ffd82acf782a32 100644 --- a/ROOT/DEBIAN/control +++ b/ROOT/DEBIAN/control @@ -3,6 +3,6 @@ Priority: optional Section: otherosfs Maintainer: Chemistry COs <support@ch.cam.ac.uk> Architecture: all -Version: 0.9-ch84 +Version: 0.9-ch85 Depends: zfs-dkms, postgresql-13 | postgresql-9.5 | postgresql-9.4 , liblockfile-simple-perl, libdbi-perl, libjson-perl, libzfs-perl-chem, libnet-openssh-perl, libdbd-pg-perl, mbuffer, rsync, nfs-kernel-server, pv, libwww-curl-perl Description: a backup system using ZFS (repository 'backup-scheduler') diff --git a/ROOT/usr/lib/xymon/client/ext/zfs-backups b/ROOT/usr/lib/xymon/client/ext/zfs-backups index 895b70c57fb74318629ab2be7c972a5386a12a97..5491f4626e818340a3ddbf4ff0b8e19b2536c926 100755 --- a/ROOT/usr/lib/xymon/client/ext/zfs-backups +++ b/ROOT/usr/lib/xymon/client/ext/zfs-backups @@ -57,7 +57,7 @@ foreach my $hr (@{$all}) { my $hostname=$hr->[0]; print "Considering $hostname\n"; my $bb=new Hobbit ({test=>'backup',hostname=>$hostname,ttl=>'60m'}); - $bb->print("Backup status on $this_server\n"); + $bb->print("Backup status on $this_server\n\n"); $sti->execute($hostname); @@ -69,10 +69,15 @@ foreach my $hr (@{$all}) { while (my $row=$sti->fetchrow_hashref) { $rows_for_this_host += 1; + my $zfs_target = $row->{'zfs_target'}; + if ($row->{'disabled'}) { $bb->color_line('green',$row->{'backup_task_name'}." is disabled\n"); } else { + my $backup_task_name = $row->{'backup_task_name'}; + $bb->print("Backup target: $zfs_target\n"); + $stj->execute($row->{'backup_task_id'}); my $detail = $stj->fetchrow_arrayref(); my $filename = $hostname . '_' . @{$detail}[0]; @@ -84,14 +89,14 @@ foreach my $hr (@{$all}) { $bb->color_line('red', "$conffile is missing\n"); } - my $thisquota = &thisquota($row->{'zfs_target'}); - my $parentquota = &parentquota($row->{'zfs_target'}); + my $thisquota = &thisquota($zfs_target); + my $parentquota = &parentquota($zfs_target); if($thisquota ne 'none') { $bb->color_line('green', "Quota of $thisquota is set\n"); } elsif($parentquota ne 'none') { $bb->color_line('green', "Parent has quota $parentquota set\n"); } else { - $bb->color_line('red', "Neither " . $row->{'zfs_target'} . " or its parent has a quota set\n"); + $bb->color_line('red', "Neither " . $zfs_target . " or its parent has a quota set\n"); } my $backup_age; @@ -137,7 +142,6 @@ foreach my $hr (@{$all}) { # or, b) the time between the last successful backup and when the conn test was last green my $timediff = $backup_age - $time_since_online; my $backup_msg = ''; - my $backup_task_name = $row->{'backup_task_name'}; my $msg_online_host = "%s is online and was last backed up %f seconds ago."; my $msg_offline_host = "%s last seen online %f seconds ago, and was last backed up %f seconds before that."; @@ -162,24 +166,23 @@ foreach my $hr (@{$all}) { } # Check for each line; we'll probably need to rewrite the hobbit parser for this - my $used=&space($row->{'zfs_target'}); - $bb->print("Backup target: $row->{'zfs_target'}\n"); + my $used=&space($zfs_target); if ($used > $row->{'space_red'}) { - $bb->color_line('red',"SpaceUsed: ".(100*$used)."% [> ".(100*$row->{'space_red'})."% ]\n"); + $bb->color_line('red',"$zfs_target SpaceUsed: ".(100*$used)."% [> ".(100*$row->{'space_red'})."% ]\n"); } elsif ($used > $row->{'space_yellow'}) { - $bb->color_line('yellow',"SpaceUsed: ".(100*$used)."% [> ".(100*$row->{'space_yellow'})."% ]\n"); + $bb->color_line('yellow',"$zfs_target SpaceUsed: ".(100*$used)."% [> ".(100*$row->{'space_yellow'})."% ]\n"); } else { - $bb->color_line('green',"SpaceUsed: ".(100*$used)."% [≤ ".(100*$row->{'space_yellow'})."% ]\n"); + $bb->color_line('green',"$zfs_target SpaceUsed: ".(100*$used)."% [≤ ".(100*$row->{'space_yellow'})."% ]\n"); } if ($row->{'prune_count'}==0) { $bb->color_line('red','No pruning configured\n'); } if (defined($row->{'exec'})) { - $bb->print("runtime: $row->{'exec'}\n"); + $bb->print("$zfs_target runtime: $row->{'exec'}\n"); } } - my $count=&snapshots($row->{'zfs_target'}); - $bb->print("Snapshots: $count\n"); + my $count=&snapshots($zfs_target); + $bb->print("Snapshots: $count\n\n"); } if($rows_for_this_host == 0) { my $msg = "No results logged for host. Check backup_log table: maybe there has not yet been a succesful backup?\n";