3 # Logwatch script for hostapd
5 # Copyright 2005 Henrik Brix Andersen <brix@gentoo.org>
6 # Distributed under the terms of the GNU General Public License v2
7 # Alternatively, this file may be distributed under the terms of the BSD License
11 my $debug = $ENV{'LOGWATCH_DEBUG'} || 0;
12 my $detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
19 print STDERR
"\n\nDEBUG: Inside HOSTAPD Filter\n\n";
22 while (defined(my $line = <STDIN
>)) {
24 print STDERR
"DEBUG($debugcounter): $line";
29 if (my ($iface,$mac,$layer,$details) = ($line =~ /(.*?): STA (.*?) (.*?): (.*?)$/i)) {
30 unless ($detail == 10) {
31 # collapse association events
32 $details =~ s/^(associated) .*$/$1/i;
34 $hostapd{$iface}->{$mac}->{$layer}->{$details}++;
36 push @unmatched, "$line\n";
41 foreach my $iface (sort keys %hostapd) {
42 print "Interface $iface:\n";
43 foreach my $mac (sort keys %{$hostapd{$iface}}) {
44 print " Client MAC Address $mac:\n";
45 foreach my $layer (sort keys %{$hostapd{$iface}->{$mac}}) {
47 foreach my $details (sort keys %{$hostapd{$iface}->{$mac}->{$layer}}) {
49 my $count = $hostapd{$iface}->{$mac}->{$layer}->{$details};
51 print ": " . $count . " Times";
60 if ($#unmatched >= 0) {
61 print "\n**Unmatched Entries**\n";