logwatch patches - mountd

"gulikoza" <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
When a NFS share is mounted, the logwatch output is pretty uninformative:

Successful NFS mounts:
    192:
       unknown: 2 Time(s)

this patch extends the information:

Successful NFS mounts:
    192.168.1.5:
       /Backup: 2 Time(s)

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-mountd.patch (application/octet-stream, 605 B)
diff --git a/scripts/services/mountd b/scripts/services/mountd
--- a/scripts/services/mountd
+++ b/scripts/services/mountd
@@ -47,6 +47,10 @@ while (defined($ThisLine = <STDIN>)) {
       $Mount = "      " . $Mount;
       $Attempted{$Name}{$Mount}++;
    }
+   elsif ( ($Name,$Mount) = ($ThisLine =~ /^authenticated (?:un)?mount request from (.+):\d+ for ([^ ]+)/) ) {
+      $Mount = "      " . $Mount;
+      $Mounted{$Name}{$Mount}++;
+   }
    elsif ( ($Name) = ($ThisLine =~ /^authenticated (?:un)?mount request from ([\w:]+)/) ) {
       $Mount = "      unknown";
       $Mounted{$Name}{$Mount}++;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.