logwatch patches - kernel (drbd)
"gulikoza" <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
There is no support for monitoring DRBD messages. Although there's a lot of
messages for which an entire module might be written, online check makes a
lot of noise in the logs.
For every block out of sync a line is printed:
1 Time(s): block drbd1: Out of sync: start=100149496, size=8 (sectors)
This increases logwatch e-mail. The attached patch ignores the above error
and prints a summary warning catching the line:
1 Time(s): block drbd1: Online verify found 636 4k block out of sync!
similar to RAID errors:
WARNING: DRBD Errors Present
drbd1 : 636 block(s) out of sync
The rest of DRBD errors are still printed but it is much less.
Regards,
gulikoza
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Logwatch-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/logwatch-devel
logwatch-drbd.patch
(application/octet-stream, 1.5 KB)
diff --git a/scripts/services/kernel b/scripts/services/kernel
--- a/scripts/services/kernel
+++ b/scripts/services/kernel
@@ -57,6 +57,7 @@
my $Ignore_rpcsec_expired = $ENV{'ignore_rpcsec_expired'} || 0;
my %SYNflood = ();
my %RAIDErrors = ();
+my %DRBDErrors = ();
my %SegFaults = ();
my %GPFaults = ();
my %TrapInt3s = ();
@@ -103,6 +104,8 @@
# Standard boot messages
next if $ThisLine =~ /Giving out device to /;
$EDACs{$1}++;
+ } elsif ($ThisLine =~ /block (drbd\d+): Online verify found (\d+) \d+k block out of sync/) {
+ $DRBDErrors{$1} = $2;
} elsif ( ( my $errormsg ) = ( $ThisLine =~ /(.*?error.{0,17})/i ) ) {
# filter out smb open/read errors cased by insufficient permissions
my $SkipError = 0;
@@ -131,6 +134,7 @@
$SkipError = 1 if $ThisLine =~ /smb_readpage_sync: .*open failed, error=-13/;
$SkipError = 1 if $ThisLine =~ /smb_open: .* open failed, result=-13/;
$SkipError = 1 if $ThisLine =~ /smb_open: .* open failed, error=-13/;
+ $SkipError = 1 if $ThisLine =~ /block drbd\d+: Out of sync: start=\d+/;
$Kernel{$ThisLine}++ if ( (! $SkipError) || ($Detail > 8)) ;
}
}
@@ -152,6 +156,13 @@
}
}
+if (keys %DRBDErrors) {
+ print "\nWARNING: DRBD Errors Present\n";
+ foreach my $Thisone ( sort {$a cmp $b} keys %DRBDErrors ) {
+ print " $Thisone : $DRBDErrors{$Thisone} block(s) out of sync\n";
+ }
+}
+
if (keys %SegFaults) {
my $header_printed=0;
foreach my $Thisone ( sort {$a cmp $b} keys %SegFaults ) {