[Logwatch-Devel] logwatch 6.1.2 patch for dhcpd's bootp log entries

Gilles Detillieux grdetil at scrc.umanitoba.ca
Sun Sep 25 14:38:57 MST 2005


While we use DHCP at our site for network configuration, there are still
a few devices configured to use BOOTP (which dhcpd also supports).  This
patch lets logwatch summarize these log entries as well...

--- /etc/log.d/scripts/services/dhcpd.orig	2005-06-09 13:16:41.000000000 -0500
+++ /etc/log.d/scripts/services/dhcpd	2005-09-23 09:52:22.000000000 -0500
@@ -39,6 +39,7 @@ while (my $line = <STDIN>) {
       ($line =~ /^Sending on/) or
       ($line =~ /^Dynamic and static leases present for/) or
       ($line =~ /^from the dynamic address pool for/) or
+      ($line =~ /^BOOTREQUEST/) or
       ($line =~ /^DHCPACK/) or
       ($line =~ /^DHCPNAK/) or
       ($line =~ /^DHCPINFORM/) or
@@ -89,6 +90,10 @@ while (my $line = <STDIN>) {
       if ($Detail >= 5) {
          $data{'Addresses Leased'}{$line}++;
       }
+   } elsif ($line =~ s/^BOOTREPLY for ([\d\.]+) to ([a-zA-Z\d_-]+) \(([a-f\d:]+)\) via (\S+)\s*$/$1 -> $3 [$2] ($4\/bootp)/) {
+      if ($Detail >= 5) {
+         $data{'Addresses Leased'}{$line}++;
+      }
    } elsif ($line =~ s/^added reverse map from ([\d]+).([\d]+).([\d]+).([\d]+).in-addr.arpa. to ([a-zA-Z\d._-]+)\s*$/Add reverse $4.$3.$2.$1 -> $5/) {
       if ($Detail >= 7) {
          $data{'DNS Mappings'}{$line}++;


-- 
Gilles R. Detillieux              E-mail: <grdetil at scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba  Winnipeg, MB  R3E 3J7  (Canada)


More information about the Logwatch-Devel mailing list