summaryrefslogtreecommitdiffstats
path: root/modules/partofme
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-30 01:29:58 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-30 01:29:58 -0500
commit38ac74234e646e73c88f98b41d327a0ff1a872dd (patch)
tree493f8462b035b6e750ce22690455ce883c4f344f /modules/partofme
parent8a7d39c3e63ba7e81a8eb2276b2e16b489fb08cc (diff)
downloadpuppet-tozt-38ac74234e646e73c88f98b41d327a0ff1a872dd.tar.gz
puppet-tozt-38ac74234e646e73c88f98b41d327a0ff1a872dd.zip
add a cron to check if there were any raid scrub errors
Diffstat (limited to 'modules/partofme')
-rw-r--r--modules/partofme/files/raid-scrub-check10
-rw-r--r--modules/partofme/manifests/persistent.pp4
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/partofme/files/raid-scrub-check b/modules/partofme/files/raid-scrub-check
new file mode 100644
index 0000000..f754067
--- /dev/null
+++ b/modules/partofme/files/raid-scrub-check
@@ -0,0 +1,10 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use 5.020;
+
+my $sysfs_file = '/sys/block/md127/md/mismatch_cnt';
+chomp(my $count = do { local $/; open my $fh, '<', $sysfs_file or die "couldn't open $sysfs_file"; <$fh> });
+if ($count > 0) {
+ die "saw a mismatch count of $count";
+}
diff --git a/modules/partofme/manifests/persistent.pp b/modules/partofme/manifests/persistent.pp
index fdc5601..57c5e5e 100644
--- a/modules/partofme/manifests/persistent.pp
+++ b/modules/partofme/manifests/persistent.pp
@@ -11,6 +11,10 @@ class partofme::persistent {
source => 'puppet:///modules/partofme/raid-scrub',
mode => '0755',
require => Class['cron'];
+ "/etc/cron.hourly/raid-scrub-check":
+ source => 'puppet:///modules/partofme/raid-scrub-check',
+ mode => '0755',
+ require => Class['cron'];
}
$fstab_line = "/dev/partofme/data /media/persistent ext4 rw,relatime,noauto 0 2"