Codebase list logwatch / dba0a96
Merge tag 'upstream/7.4.1' Upstream version 7.4.1 Willi Mann 9 years ago
27 changed file(s) with 385 addition(s) and 438 deletion(s). Raw diff Collapse all Expand all
66 1. Table of Contents
77 2. Introduction
88 3. Directory Structure
9 A. Configuration Structure
10 B. Executable Structure
9 A. Configuration Structure
10 B. Executable Structure
1111 4. Customizing the Configuration
1212 5. Customizing the Scripts
1313 6. Creating New Service Filters
14 A. Logfile Groups
15 B. Service Filter Configuration
16 C. Service Filer Executable
17 D. Shared Script Commands
14 A. Logfile Groups
15 B. Service Filter Configuration
16 C. Service Filer Executable
17 D. Shared Script Commands
1818 7. For More Information
1919
2020
557557 - access to the svn repository, for the very latest code.
558558
559559 If you do create new services or enhancements that you feel would be useful
560 to other people, please send them to the logwatch-devel mailing list
561 at logwatch.org.
560 to other people, please send them to the mailing list 'logwatch-devel at
561 lists.sourceforge.net'.
562562
563563 If you send patches, please make sure that you have the latest version
564564 of the file from svn, and send the patch file in unified format
6565 You can also use it from the command line (as documented in the
6666 man page).
6767
68 There is some documentation available in Italian here:
69 http://openskills.info/view/boxdetail.php?IDbox=656
70
7168 ------------------------------------------------------------------
7269
7370 If you want me to add support for a new set of log entries, please
7875 ------------------------------------------------------------------
7976
8077 Mailing lists available!
81
82 Logwatch List:
83 For general discussion and questions about Logwatch.
84 To Subscribe: echo "subscribe" | mail logwatch-request@kaybee.org
85 Send Mail To: logwatch@kaybee.org
86
87 Logwatch Announcements List:
88 For important announcements about Logwatch.
89 To Subscribe: echo "subscribe" | mail logwatch-announce-request@kaybee.org
9078
9179 Logwatch Development List:
9280 For discussion about Logwatch development.
10896 http://www.kaybee.org/kirk/
10997
11098 Newest releases can be found at:
111 ftp://ftp.logwatch.org/pub/redhat/RPMS
112 http://www.logwatch.org
99 https://sourceforge.net/projects/logwatch/files/
100
2020 #########################################################################
2121
2222 # What actual file? Defaults to LogPath if not absolute path....
23 LogFile = maillog spamd/spamd.log
23 LogFile = spamd/spamd.log
2424
2525 # If the archives are searched, here is one or more line
2626 # (optionally containing wildcards) that tell where they are...
27 Archive = maillog[.-]* spamd/spamd.log[.-]*
28 Archive = maillog[.-]*.gz spamd/spamd.log[.-]*.gz
27 Archive = spamd/spamd.log[.-]*
28 Archive = spamd/spamd.log[.-]*.gz
2929
3030 # Keep only the lines in the proper date range...
3131 *ApplyStdDate
00 ###########################################################################
1 # $Id: fail2ban.conf 149 2013-06-18 22:18:12Z mtremaine $
1 # $Id: fail2ban.conf 205 2014-09-08 19:15:49Z stefjakobs $
22 ###########################################################################
33 # $Log: fail2ban.conf,v $
44 # Revision 1.1 2006/05/30 19:04:26 bjorn
2121 # Which logfile group...
2222 LogFile = fail2ban
2323
24
24 # Only give lines pertaining to the fail2ban service...
25 # Note: fail2ban logs using "service" names fail2ban, fail2ban.jail,
26 # fail2ban.filter, and many more. We want to exclude fail2ban-client
27 # so we accept either fail2ban or fail2ban\..+
28 *OnlyService = fail2ban(|\..+)
29 *RemoveHeaders
4343 # Ignore requests
4444 # Note - will not do ANY processing, counts, etc... just skip it and go to
4545 # the next entry in the log file.
46 # Note - The match will be case insensitive; e.g. /model/ == /MoDel/
4647 # Examples:
4748 # 1. Ignore all URLs starting with /model/ and ending with 1 to 10 digits
4849 # $HTTP_IGNORE_URLS = ^/model/\d{1,10}$
44
55 Title = "SpamAssassin"
66 LogFile = spamassassin
7 LogFile = maillog
78 # Pull in sendmail for matching msgid to sender for statistics
89 *OnlyService = (spamd|sendmail)
910 *RemoveHeaders
2525 # File: install_logwatch.sh
2626 # Author: Mike Tremaine [mgt /at/ stellarcore.net]
2727 # Maintainer: Mike Tremaine [mgt /at/ stellarcore.net]
28 # $Id: install_logwatch.sh 147 2013-06-18 21:43:31Z mtremaine $
28 # $Id: install_logwatch.sh 241 2014-09-23 11:50:13Z stefjakobs $
2929 #
3030 # $Log: install_logwatch.sh,v $
3131 # Revision 1.20 2008/05/12 22:53:28 mike
175175
176176 #OS Tests for known issues
177177 if [ $OS = "Darwin" ]; then
178 munge_gzcat = 1
178 munge_gzcat=1
179179 fi
180180
181181 #Install is borked under IRIX
279279 else
280280 #MacOS X aka Darwin no -u [even thought the manpage says]
281281 if [ $OS = "Darwin" ]; then
282 makewhatis -s "1 5 8" $MANDIR
282 makewhatis -o "1 5 8" $MANDIR
283283 else
284284 #Linux
285285 makewhatis -u -s "1 5 8" $MANDIR
519519 } else {
520520 $LogFileData{$ThisLogFile}{$ReadConfigNames[$i]} = $ReadConfigValues[$i];
521521 }
522 for my $i (0..$#CmdList) {
523 $LogFileData{$ThisLogFile}{+sprintf("%03d-%s", $i, $CmdList[$i])} = $CmdArgList[$i];
524 }
522 }
523 for my $i (0..$#CmdList) {
524 $LogFileData{$ThisLogFile}{+sprintf("%03d-%s", $i, $CmdList[$i])} = $CmdArgList[$i];
525525 }
526526 }
527527 }
4848 no warnings "uninitialized";
4949 use re 'taint';
5050
51 our $Version = '1.51.02';
51 our $Version = '1.51.03';
5252 our $progname_prefix = 'amavis';
5353
5454 # Specifies the default configuration file for use in standalone mode.
18401840 #
18411841
18421842 sub create_ignore_list() {
1843 push @ignore_list_final, qr/^RUSAGE: /;
18441843 push @ignore_list_final, qr/^lookup_ip_acl/;
18451844 push @ignore_list_final, qr/^lookup_acl/;
18461845 push @ignore_list_final, qr/^lookup_hash/;
20142013 push @ignore_list_final, qr/^Load low precedence policybank/;
20152014 push @ignore_list_final, qr/^warm restart on /; # XXX could be placed instartup info
20162015 push @ignore_list_final, qr/^Signalling a SIGHUP to a running daemon/;
2017 push @ignore_list_final, qr/^Deleting db files nanny.db in /;
2016 push @ignore_list_final, qr/^Deleting db files /;
20182017 push @ignore_list_final, qr/^address modified \(/;
2018 push @ignore_list_final, qr/^Request: AM\.PDP /;
2019 push @ignore_list_final, qr/^DSPAM result: /;
2020 push @ignore_list_final, qr/^bind to \//;
2021 push @ignore_list_final, qr/^ZMQ enabled: /;
2022
2023 push @ignore_list_final, qr/^Inserting header field: X-Amavis-Hold: /;
2024 push @ignore_list_final, qr/^Decoding of .* failed, leaving it unpacked: /;
20192025
20202026 # various forms of "Using ..."
20212027 # more specific, interesting variants already captured: search "Using"
20262032 push @ignore_list_final, qr/creating socket by /;
20272033
20282034 # unanchored
2035 push @ignore_list_final, qr/\bRUSAGE\b/;
20292036 push @ignore_list_final, qr/: Sending .* to UNIX socket/;
20302037 }
20312038
21132120 or ($p1 =~ /^SpamControl/)
21142121 or ($p1 =~ /^Perl/)
21152122 or ($p1 =~ /^ESMTP/)
2116 or ($p1 =~ /^(?:\(!+\))?(?:FWD|SEND) from /) # log level 4
2117 or ($p1 =~ /^(?:\(!+\))?(?:ESMTP|FWD|SEND) via /) # log level 4
2123 or ($p1 =~ /^(?:\(!+\))?(\S+ )?(?:FWD|SEND) from /) # log level 4
2124 or ($p1 =~ /^(?:\(!+\))?(\S+ )?(?:ESMTP|FWD|SEND) via /) # log level 4
21182125 or ($p1 =~ /^tempdir being removed/)
21192126 or ($p1 =~ /^do_notify_and_quar(?:antine)?: .*ccat/)
21202127 or ($p1 =~ /^cached [a-zA-Z0-9]+ /)
24812488 $Totals{'truncatedmsg'}++;
24822489 }
24832490
2484 elsif ( $p1 =~ /: spam level exceeds quarantine cutoff level/ ) {
2491 elsif ($p1 =~ /: spam level exceeds quarantine cutoff level/ or
2492 $p1 =~ /: cutoff, blacklisted/) {
24852493 #TD do_notify_and_quarantine: spam level exceeds quarantine cutoff level 20
2494 #TD do_notify_and_quarantine: cutoff, blacklisted
24862495 $Totals{'spamdiscarded'}++;
24872496 }
24882497
27562765 #TD SA warn: FuzzyOcr: Skipping ocrad-decolorize, image too small
27572766 #$Counts{'sadiags'}{'fuzzyocr'}{'image too small'}++;
27582767 next;
2768 }
2769 elsif ($msg =~ /dns: \[\.\.\.\]/) {
2770 #TD SA info: dns: [...] ;; ADDITIONAL SECTION (1 record)
2771 next;
2772 }
2773 # canonicalize some PIDs and IDs
2774 elsif ($msg =~ s/^pyzor: \[\d+\] error/pyzor: [<PID>] error/) {
2775 #TD SA info: pyzor: [11550] error: TERMINATED, signal 15 (000f)
2776 }
2777 elsif ($msg =~ /dns: no likely matching queries for id \d+/) {
2778 $msg =~ s/\d+/<ID>/;
2779 }
2780 elsif ($msg =~ /dns: no callback for id \d+/) {
2781 $msg =~ s/\d+.*$/<ID>.../;
27592782 }
27602783
27612784 # report other SA warn's
30133036 }
30143037
30153038 # Timing report
3016 } elsif (my ($total,$report) = ( $p1 =~ /^(?:size: \d+, )?TIMING \[total (\d+) ms\] - (.+)$/)) {
3039 } elsif (my ($total,$report) = ( $p1 =~ /^(?:size: \d+, )?TIMING \[total (\d+) ms(?:, [^]]+)?\] - (.+)$/)) {
30173040 next if ($report =~ /^got data/); # skip amavis release timing
3018
30193041 #TD TIMING [total 5808 ms] - SMTP greeting: 5 (0%)0, SMTP LHLO: 1 (0%)0, SMTP pre-MAIL: 2 (0%)0, SMTP pre-DATA-flush: 5 (0%)0, SMTP DATA: 34 (1%)1, check_init: 1 (0%)1
30203042 # older format, maia mailguard
30213043 #TD TIMING [total 3795 ms] - SMTP EHLO: 1 (0%), SMTP pre-MAIL: 0 (0%), maia_read_system_config: 1 (0%), maia_get_mysql_size_limit: 0 (0%), SA check: 3556 (94%), rundown: 0 (0%)
3044 # v2.8.1
3045 # .... size: 3815, TIMING [total 1901 ms, cpu 657 ms] - ...
3046
30223047
30233048 # Timing line is incomplete - let's report it
30243049 if ($p1 !~ /\d+ \(\d+%\)\d+$/ and $p1 !~ /\d+ \(\d+%\)$/) {
30303055 my @pairs = split(/[,:] /, $report);
30313056 while (my ($key,$value) = @pairs) {
30323057 #4 (0%)0
3033 my ($ms) = ($value =~ /^(\d+) /);
3058 my ($ms) = ($value =~ /^([\d.]+) /);
30343059 # maintain a per-test list of timings
30353060 push @{$Timings{$key}}, $ms;
30363061 shift @pairs; shift @pairs;
30383063 push @TimingsTotals, $total;
30393064 }
30403065
3041 } elsif (($total,$report) = ( $p1 =~ /^TIMING-SA total (\d+) ms - (.+)$/ )) {
3066 } elsif ((($total,$report) = ( $p1 =~ /^TIMING-SA total (\d+) ms - (.+)$/ )) or
3067 (($total,$report) = ( $p1 =~ /^TIMING-SA \[total (\d+) ms, cpu \d+ ms\] - (.+)$/ ))) {
3068 #TIMING-SA [total 3219 ms, cpu 432 ms] - parse: 6 (0.2%), ext
30423069 #TD TIMING-SA total 5478 ms - parse: 1.69 (0.0%), extract_message_metadata: 16 (0.3%), get_uri_detail_list: 2 (0.0%), tests_pri_-1000: 25 (0.4%), tests_pri_-950: 0.67 (0.0%), tests_pri_-900: 0.83 (0.0%), tests_pri_-400: 19 (0.3%), check_bayes: 17 (0.3%), tests_pri_0: 5323 (97.2%), check_spf: 12 (0.2%), poll_dns_idle: 0.81 (0.0%), check_dkim_signature: 1.50 (0.0%), check_razo r2: 5022 (91.7%), check_dcc: 192 (3.5%), check_pyzor: 0.02 (0.0%), tests_pri_500: 9 (0.2%), tests_pri_1000: 24 (0.4%), total_awl: 23 (0.4%), check_awl: 10 (0.2%), update_awl: 8 (0.1%), learn: 36 (0.7%), get_report: 1.77 (0.0%)
30433070
30443071 # Timing line is incomplete - let's report it
31013128 }
31023129
31033130 elsif (($suffix, $decoder) = ( $p1 =~ /^Found decoder for\s+(\.\S*)\s+at\s+(.*)$/)) {
3131 #TD Found decoder for .bz2 at /usr/bin/bzip2 -d
3132 #TD Found decoder for .bz2 at /usr/bin/7za (backup, not used)
31043133 next unless ($Opts{'startinfo'});
3105 $StartInfo{'Decoders'}{'External'}{$suffix} = $decoder;
3134 $StartInfo{'Decoders'}{'External'}{$suffix} = exists $StartInfo{'Decoders'}{'External'}{$suffix} ?
3135 join '; ', $StartInfo{'Decoders'}{'External'}{$suffix}, $decoder : $decoder;
31063136 }
31073137
31083138 # AV Scanners
31293159 next unless ($Opts{'startinfo'});
31303160 $StartInfo{'Code'}{"\u\L$loaded"}{$code} = "";
31313161
3132 } elsif (my ($module, $vers,) = ( $p1 =~ /^Module (\S+)\s+(.+)$/)) {
3162 } elsif (my ($module, $vers) = ( $p1 =~ /^Module (\S+)\s+(.+)$/)) {
31333163 #TD Module Amavis::Conf 2.086
31343164 next unless ($Opts{'startinfo'});
31353165 $StartInfo{'Code'}{'Loaded'}{$module} = $vers;
3166
3167 } elsif (($module, my $families) = ( $p1 =~ /^socket module (\S+),\s+(.+)$/)) {
3168 #TD socket module IO::Socket::IP, protocol families available: INET, INET6
3169 next unless ($Opts{'startinfo'});
3170 $StartInfo{'Code'}{'Loaded'}{$module} = $families;
31363171
31373172 } elsif (($code, $location) = ( $p1 =~ /^Found \$(\S+)\s+at\s+(.+)$/)) {
31383173 #TD Found $file at /usr/bin/file
31443179 #TD No $dspam, not using it
31453180 next unless ($Opts{'startinfo'});
31463181 $StartInfo{'Code'}{'Not loaded'}{$code} = $location;
3182
3183 } elsif (($code, $location) = ( $p1 =~ /^No ext program for\s+([^,]+), (tried: .+)/)) {
3184 #TD No ext program for .kmz, tried: 7za, 7z
3185 #TD No ext program for .F, tried: unfreeze, freeze -d, melt, fcat
3186 next unless ($Opts{'startinfo'});
3187 $StartInfo{'Code'}{'Not found'}{$code} = $location;
3188
31473189
31483190 } elsif ( $p1 =~ /^starting\.\s+(.+) at \S+ (?:amavisd-new-|Maia Mailguard )([^,]+),/) {
31493191 #TD starting. /usr/local/sbin/amavisd at mailhost.example.com amavisd-new-2.5.0 (20070423), Unicode aware, LANG="C"
00
11 ##########################################################################
2 # $Id: audit 199 2014-07-14 15:48:15Z opoplawski $
2 # $Id: audit 224 2014-09-09 10:07:12Z stefjakobs $
33 ##########################################################################
44 # $Log: audit,v $
55 # Revision 1.15 2009/02/20 17:59:47 mike
8888 my $NumberOfDStops = 0;
8989 my $NumberOfDdStarts = 0;
9090 my $NumberOfDdStops = 0;
91 my $NumberOfAllowedMessages = 0;
9192 my $NumberOfLostMessages = 0;
9293 my %InvalidContext = ();
9394 my %BugLog = ();
140141 $NumberOfDStarts++;
141142 } elsif ( $ThisLine =~ /The audit daemon is exiting./) {
142143 $NumberOfDStops++;
143 } elsif ( $ThisLine =~ /audit_lost=[0-9]+ audit_backlog=[0-9]+ audit_rate_limit=[0-9]+ audit_backlog_limit=[0-9]+$/) {
144 } elsif ( $ThisLine =~ /audit_lost=[0-9]+ (audit_backlog=[0-9]+ )?audit_rate_limit=[0-9]+ audit_backlog_limit=[0-9]+$/) {
144145 $NumberOfLostMessages++;
145146 } elsif ( $ThisLine =~ /auditd startup succeeded/) {
146147 $NumberOfDdStarts++;
165166 # type=1400 audit(1314853822.672:33649): apparmor="DENIED" operation="mknod" parent=27250 profile="/usr/lib/apache2/mpm-prefork/apache2//example.com" name="/usr/share/wordpress/1114140474e5f13bea68a4.tmp" pid=27289 comm="apache2" requested_mask="c" denied_mask="c" fsuid=33 ouid=33
166167 # type=1400 audit(1315353795.331:33657): apparmor="DENIED" operation="exec" parent=14952 profile="/usr/lib/apache2/mpm-prefork/apache2//example.com" name="/usr/lib/sm.bin/sendmail" pid=14953 comm="sh" requested_mask="x" denied_mask="x" fsuid=33 ouid=0
167168 $denials{$1.' '.$3.' ('.$2.' via '.$4 . ')'}++;
169 } elsif ( $ThisLine =~ /apparmor="ALLOWED" operation="([^"]+)" (info="([^"]+)" )?(error=[+-]?\d+ )?parent=\d+ profile="([^"]+)" (name="([^"]+)" )?pid=\d+ comm="([^"]+)"/ ) {
170 # type=1400 audit(1369519203.141:259049): apparmor="ALLOWED" operation="exec" parent=3733 profile="/usr/sbin/dovecot//null-1c//null-1d" name="/usr/lib/dovecot/pop3-login" pid=24634 comm="dovecot" requested_mask="x" denied_mask="x" fsuid=0 ouid=0 target="/usr/sbin/dovecot//null-1c//null-1d//null-d12"
171 # type=1400 audit(1369627891.522:447576): apparmor="ALLOWED" operation="capable" parent=1 profile="/usr/sbin/dovecot//null-1c//null-1d" pid=3733 comm="dovecot" capability=5 capname="kill"
172 # type=1400 audit(1369823965.682:824587): apparmor="ALLOWED" operation="getattr" info="Failed name lookup - deleted entry" error=-2 parent=1 profile="/usr/sbin/dovecot//null-1c//null-1d" name="/var/lib/dovecot/.temp.3733.d786c1fcaaa73248" pid=3733 comm="dovecot" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
173 $NumberOfAllowedMessages++;
168174 } else {
169175 $othercount++;
170176 $ThisLine =~ s/^\s*//;
277283 }
278284 }
279285
286 if ($NumberOfAllowedMessages) {
287 print "\n Number of allowed messages: $NumberOfAllowedMessages\n";
288 }
289
280290 if ($NumberOfLostMessages) {
281291 print "\n Number of lost messages: $NumberOfLostMessages\n";
282292 }
00
11 use strict;
22 ##########################################################################
3 # $Id: dhcpd 150 2013-06-18 22:19:38Z mtremaine $
3 # $Id: dhcpd 236 2014-09-15 22:10:32Z bjorn1 $
44 ##########################################################################
55
66 ########################################################
7777 } elsif (
7878 ($line =~ /^you want, please write a subnet declaration/) or
7979 ($line =~ /^in your dhcpd.conf file for the network segment/) or
80 ($line =~ /^to which interface [a-z\d]+ is attached./) or
80 ($line =~ /^to which interface [a-z\d\.]+ is attached./) or
8181
8282 ($line =~ /^If you did not get this software from ftp.isc.org, please/) or
8383 ($line =~ /^get the latest from ftp.isc.org and install that before/) or
110110 $data{'Generic error'}{$line}++;
111111 } elsif ($line =~ /^There's already a DHCP server running./) {
112112 $data{'Generic error'}{$line}++;
113 } elsif ($line =~ s/^\*\* Ignoring requests on ([a-z\d]+). If this is not what\s*$/Ignoring interface $1/) {
114 $data{'Config error'}{$line}++;
115 } elsif ($line =~ s/^No subnet6? declaration for ([a-z\d]+) ([\(\)\d\.ia-fA-F:]+).\s*$/No subnet declaration for $1 $2/) {
113 } elsif ($line =~ s/^\*\* Ignoring requests on ([a-z\d\.]+). If this is not what\s*$/Ignoring interface $1/) {
114 $data{'Config error'}{$line}++;
115 } elsif ($line =~ s/^No subnet6? declaration for ([a-z\d\.]+) ([\(\)\d\.ia-fA-F:]+).\s*$/No subnet declaration for $1 $2/) {
116116 $data{'Config error'}{$line}++;
117117 } elsif ($line =~ /^If this DHCP server is authoritative for that subnet,$/) {
118118 $data{'Config error'}{'missing authoritative directive'}++;
160160 if ($Detail >= 5) {
161161 $data{'Addresses Released'}{$line}++;
162162 }
163 } 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/) {
164 if ($Detail >= 7) {
165 $data{'DNS Mappings'}{$line}++;
166 }
167 } elsif ($line =~ s/^removed reverse map on ([\d]+).([\d]+).([\d]+).([\d]+).in-addr.arpa.\s*$/Remove reverse $4.$3.$2.$1/) {
163 } elsif ($line =~ s/^[Aa]dded reverse map from ([\d]+)\.([\d]+)\.([\d]+)\.([\d]+)\.in-addr\.arpa\.? to ([a-zA-Z\d._-]+)\s*$/Add reverse $4.$3.$2.$1 -> $5/) {
164 if ($Detail >= 7) {
165 $data{'DNS Mappings'}{$line}++;
166 }
167 } elsif ($line =~ s/^[Rr]emoved reverse map on ([\d]+)\.([\d]+)\.([\d]+)\.([\d]+)\.in-addr\.arpa\.?\s*$/Remove reverse $4.$3.$2.$1/) {
168168 if ($Detail >= 7) {
169169 $data{'DNS Mappings'}{$line}++;
170170 }
171171 } elsif ($line =~ s/^Added new forward map from ([a-zA-Z\d\-_.]+) to ([\d.]+)\s*$/Add forward $1 -> $2/) {
172172 if ($Detail >= 7) {
173173 $data{'DNS Mappings'}{$line}++;
174 }
175 } elsif ($line =~ s/^Removed forward map from ([a-zA-Z\d\-_.]+) to ([\d.]+)\s*$/Remove forward $1 -> $2/) {
176 if ($Detail >= 7) {
177 $data{'DNS Mappings'}{$line}++;
178 }
179 } elsif ($line =~ /^No hostname for [\d.]+\s*$/) {
180 if ($Detail >= 7) {
181 $data{'Warnings'}{$line}++;
174182 }
175183 } elsif ($line =~ s/^if ([a-zA-Z\d\-_.]+) IN A rrset doesn't exist delete ([a-zA-Z\d\-_.]+) IN TXT "([a-f\d]+)": success.\s*$/Remove forward TXT from $1 (TXT "$3")/) {
176184 if ($Detail >= 7) {
00 ########################################################
1 # $Id: dovecot 197 2014-05-30 17:31:32Z opoplawski $
1 # $Id: dovecot 225 2014-09-09 10:12:29Z stefjakobs $
22 ########################################################
33 # $Log: dovecot,v $
44 # Revision 1.18 2010/09/18 17:41:00 stefan
255255 $Disconnected{"no reason"}++;
256256 } elsif (($Reason) = ($ThisLine =~ /Disconnected: (.*) \[/) ) {
257257 $Disconnected{$Reason}++;
258 } elsif (($Reason) = ($ThisLine =~ /Disconnected: (.*) (bytes|top)=.*/) ) {
258 } elsif (($Reason) = ($ThisLine =~ /Disconnected: (.*) (bytes|top|in)=.*/) ) {
259259 $Disconnected{$Reason}++;
260260 } elsif (($Reason) = ($ThisLine =~ /Disconnected \((.*)\):/) ) {
261261 $Disconnected{$Reason}++;
262262 } elsif ($ThisLine =~ /Disconnected (bytes|top)=.*/) {
263263 $Disconnected{"No reason"}++;
264 } elsif ($ThisLine =~ /Server shutting down./) {
265 $ConnectionCl{"Server shutting down"}++;
264266 } elsif (($Reason, $Host) = ($ThisLine =~ /TLS initialization failed/) ) {
265267 $TLSInitFail++;
266268 } elsif (($Host) = ($ThisLine =~ /Aborted login:.* rip=(.*),/) ) {
00 ##########################################################################
1 # $Id: exim 158 2013-08-19 09:17:57Z stefjakobs $
2 ##########################################################################
3 # $Log: exim,v $
4 # Revision 1.25 2010/09/18 17:31:00 stefan
5 # removing unused variable $tz
6 #
7 # Revision 1.24 2009/06/02 14:50:37 mike
8 # Patch from Fedora (Ivan Varekova) -mgt
9 #
10 # Revision 1.23 2008/06/30 23:07:51 kirk
11 # fixed copyright holders for files where I know who they should be
12 #
13 # Revision 1.22 2008/03/24 23:31:26 kirk
14 # added copyright/license notice to each script
15 #
16 # Revision 1.21 2008/01/16 20:29:18 bjorn
17 # Optimizing by using push, as per Steve Holden.
18 #
19 # Revision 1.20 2007/02/11 01:50:47 bjorn
20 # New handling of problem addresses, DNSBL warnings, and other transaction
21 # and connection errors, by Nigel Metheringham
22 #
23 # Revision 1.19 2006/08/23 21:19:02 bjorn
24 # Process Greylisting, by Jan Pazdziora.
25 #
26 # Revision 1.18 2006/03/02 16:22:23 bjorn
27 # Additional error detection, by Gary Allen Vollink.
28 #
29 # Revision 1.17 2005/11/02 17:03:12 bjorn
30 # Additional patches, from Ruth Ivimey-Cook.
31 #
32 # Revision 1.16 2005/11/02 16:05:18 bjorn
33 # Significant expansion of detecting and reporting error messages, by
34 # Ruth Ivimey-Cook; deleted redundant errors, by Gary Allen Vollink
35 #
36 # Revision 1.15 2005/09/27 19:52:42 bjorn
37 # Handle reverse lookup failures, by Stig Brautaset
38 #
39 # Revision 1.14 2005/05/25 23:09:28 bjorn
40 # Added filters for malware/viruses, and protocol errors, by Gary Allen Vollink.
41 #
1 # $Id: exim 217 2014-09-09 09:21:20Z stefjakobs $
422 ##########################################################################
433
444 ########################################################
161121 $DontAccept{$ThisLine}++;
162122 }
163123 elsif ( $ThisLine =~ /do not accept mail / ) {
124 $DontAccept{$ThisLine}++;
125 }
126 elsif ( $ThisLine =~ /rejected connection in .connect. ACL/ ) {
127 # Likely policy rejections
164128 $DontAccept{$ThisLine}++;
165129 }
166130 elsif ( $ThisLine =~ /believed to be spam/ ) {
420384 if ($Detail >= $LvlDontAccept) {
421385 # Print Administrative Prohibitions
422386 if (%DontAccept) {
423 my (%spam);
387 my (%spam, %detail);
424388 my (@errList);
425389
426390 # Probable SPAM hosts...
439403 $cc = "Blocked Email Domain";
440404 $bb = "$1\@$2";
441405 }
406 elsif ( $ThisOne =~ m/rejected connection in .connect. ACL/ ) {
407 $cc = "Blocked Host";
408 ( $bb ) = ($ThisOne =~ m/\[(\d+\.\d+\.\d+\.\d+)\]/);
409 }
442410 elsif ( $ThisOne =~ m/mail not permitted from sender ([\w\*-_.]+)@([\w.-_]+)/ ) {
443411 $cc = "Blocked Email Address";
444412 $bb = "$1\@$2";
473441 }
474442 elsif ( $ThisOne =~ m/remote host address is the local host/ ) {
475443 $cc = "Invalid local domain";
476 ( $bb ) = ($ThisOne =~ m/\@\[^>]+/);
444 ( $bb ) = ($ThisOne =~ m/\@[^>]+/);
477445 }
478446 else {
479447 # If we picked up a malfunction but didn't collect it here,
482450 #next;
483451 print "Didn't Summarize: $ThisOne\n";
484452 }
485 if (defined( $spam{$cc} )) {
486 $mid = $spam{$cc};
487 }
488 $spam{$cc} = "$mid$aa : $bb,";
453 if ($cc =~ m/Blocked/ ) {
454 # hash of blocked things
455 my $h = {};
456 if (!defined($detail{$cc})) {
457 # debug print "add type $cc\n" ;
458 $detail{$cc} = $h;
459 }
460 $h = $detail{$cc};
461
462 if (defined($h{$bb})) {
463 # debug print "add $bb to ".$h{$bb}."\n" ;
464 $h{$bb} = $h{$bb} + 1;
465 }
466 else {
467 $h{$bb} = 1;
468 # debug print "start $bb at ".$h{$bb}."\n" ;
469 }
470 # marker
471 $spam{$cc} = "";
472 }
473 else {
474
475 if (defined( $spam{$cc} )) {
476 $mid = $spam{$cc};
477 }
478 $spam{$cc} = "$mid$aa : $bb,";
479
480 }
489481 }
490482 foreach $ThisOne (sort(keys %spam)) {
491483 if ($Detail >= $LvlDontAcceptLines) {
492 print " $ThisOne\n";
493 foreach $aa ( sort( split /,/, $spam{$ThisOne} )) {
494 print " $aa\n";
484 if ($spam{$cc} eq "") {
485 print " $ThisOne\n";
486 my $h = $detail{$ThisOne};
487 foreach $aa (sort(keys %h) ) {
488 print " $aa : ".$h{$aa}." times\n";
489 }
490 }
491 else {
492 print " $ThisOne\n";
493 foreach $aa ( sort( split /,/, $spam{$ThisOne} )) {
494 print " $aa\n";
495 }
495496 }
496497 }
497498 else {
00 ##########################################################################
1 # $Id: fail2ban 150 2013-06-18 22:19:38Z mtremaine $
1 # $Id: fail2ban 226 2014-09-09 11:07:27Z stefjakobs $
22 ##########################################################################
33 # $Log: fail2ban,v $
44 # Revision 1.5 2008/08/18 16:07:46 mike
6666 ($ThisLine =~ /..,... \S*\s*: DEBUG /) or # syntax of 0.7.? fail2ban
6767 ($ThisLine =~ /..,... INFO: (Fail2Ban v.* is running|Exiting|Enabled sections:)/) or
6868 ($ThisLine =~ /INFO\s+Log rotation detected for/) or
69 ($ThisLine =~ /INFO\s+Jail.+(?:stopped|started|uses poller)/) or
69 ($ThisLine =~ /INFO\s+Jail.+(?:stopped|started|uses poller|uses pyinotify)/) or
7070 ($ThisLine =~ /INFO\s+Changed logging target to/) or
7171 ($ThisLine =~ /INFO\s+Creating new jail/) or
7272 ($ThisLine =~ /..,... \S+\s*: INFO\s+(Set |Socket|Exiting|Gamin|Created|Added|Using)/) or # syntax of 0.7.? fail2ban
7373 ($ThisLine =~ /..,... WARNING: Verbose level is /) or
74 ($ThisLine =~ /..,... WARNING: Restoring firewall rules/)
74 ($ThisLine =~ /..,... WARNING: Restoring firewall rules/) or
75 ($ThisLine =~ /WARNING Determined IP using DNS Lookup: [^ ]+ = \['[^']+'\]/) or
76 ($ThisLine =~ /INFO\s+(Stopping all jails|Exiting Fail2ban)/) or
77 ($ThisLine =~ /INFO\s+Initiated 'pyinotify' backend/) or
78 ($ThisLine =~ /INFO\s+(Added logfile = .*|Set maxRetry = \d+|Set findtime = \d+|Set banTime = \d+)/)
7579 )
7680 {
7781 if ( $Debug >= 6 ) {
7882 print STDERR "DEBUG($DebugCounter): line ignored\n";
7983 }
80 } elsif ( my ($Service,$Action,$Host) = ($ThisLine =~ m/WARNING:?\s\[?(.*?)[]:]?\s(Ban|Unban)[^\.]* (\S+)/)) {
84 } elsif ( my ($Service,$Action,$Host) = ($ThisLine =~ m/(?:WARNING|NOTICE):?\s\[?(.*?)[]:]?\s(Ban|Unban)[^\.]* (\S+)/)) {
8185 if ( $Debug >= 6 ) {
8286 print STDERR "DEBUG($DebugCounter): Found $Action for $Service from $Host\n";
8387 }
9094 push @{$ServicesBans{$Service}{$Host}{'Failures'}}, $NumFailures;
9195 } elsif ( my ($Service,$Host) = ($ThisLine =~ m/ ERROR:\s(.*):\s(\S+)\salready in ban list/)) {
9296 $ServicesBans{$Service}{$Host}{'AlreadyInTheList'}++;
93 } elsif ( my ($Service,$Host) = ($ThisLine =~ m/WARNING\s*\[(.*)\]\s*(\S+)\s*already banned/)) {
97 } elsif ( my ($Service,$Host) = ($ThisLine =~ m/(?:INFO|WARNING)\s*\[(.*)\]\s*(\S+)\s*already banned/)) {
9498 $ServicesBans{$Service}{$Host}{'AlreadyInTheList'}++;
9599 } elsif ( my ($Service,$Host) = ($ThisLine =~ m/ WARNING:\s(.*):\sReBan (\S+)/)) {
96100 $ServicesBans{$Service}{$Host}{'ReBan'}++;
00 ##########################################################################
1 # $Id: fetchmail 150 2013-06-18 22:19:38Z mtremaine $
1 # $Id: fetchmail 230 2014-09-09 12:30:37Z stefjakobs $
22 ##########################################################################
33
44 ########################################################
5050 $conn_fail{"${1} -- ${2}"}++;
5151 } elsif($ThisLine =~ s/^(\d+) messages? for (\S+) at (\S+).*.//) {
5252 $messages_for{"${2} at ${3}"} += $1;
53 } elsif($ThisLine =~ s/^(\d+) messages? \((\d+) seen\) for (\S+) at (\S+).*.//) {
54 $messages_for{"${3} at ${4}"} += ($1-$2);
5355 } else {
5456 chomp($ThisLine);
5557 # Report any unmatched entries...
00 ##########################################################################
1 # $Id: http 179 2014-01-09 16:29:00Z opoplawski $
1 # $Id: http 233 2014-09-09 15:52:31Z stefjakobs $
22 ##########################################################################
33
44 #####################################################
112112
113113 ######################
114114 # file type comparisons are case-insensitive
115 my $image_types = '(\.bmp|\.cdr|\.emz|\.gif|\.ico|\.jpeg|\.jpg|\.png|\.svg|\.sxd|\.tif|\.tiff|\.wbmp|\.wmf|\.wmz|\.xdm)';
115 my $image_types = '(\.bmp|\.cdr|\.emz|\.gif|\.ico|\.jpe?g|\.png|\.svg|\.sxd|\.tiff?|\.wbmp|\.webp|\.wmf|\.wmz|\.xdm)';
116116 my $content_types = '(';
117117 $content_types = $content_types.'\/server-status|\/server-info';
118118 $content_types = $content_types.'|\.htm|\.html|\.jhtml|\.phtml|\.shtml|\/\.?';
126126 $content_types = $content_types.'|\.fla|\.swf|\.rdf';
127127 $content_types = $content_types.'|\.class|\.jsp|\.jar|\.java';
128128 $content_types = $content_types.'|COPYRIGHT|README|FAQ|INSTALL|\.txt)';
129 my $docs_types = '(\.asc|\.bib|\.djvu|\.doc|\.dot|\.dtd|\.dvi|\.gnumeric|\.mcd|\.mso|\.pdf|\.pps|\.ppt|\.ps|\.rtf|\.sxi|\.tex|\.text|\.tm|\.xls|\.xml)';
130 my $archive_types = '(\.ace|\.bz2|\.cab|\.deb|\.dsc|\.ed2k|\.gz|\.hqx|\.md5|\.rar|\.rpm|\.sig|\.sign|\.tar|\.tbz2|\.tgz|\.vl2|\.z|\.zip|\.hdr)';
131 my $sound_types = '(\.au|\.aud|\.mid|\.mp3|\.ogg|\.pls|\.ram|\.raw|\.rm|\.wav|\.wma|\.wmv|\.xsm)';
132 my $movie_types = '(\.asf|\.ass|\.avi|\.idx|\.mid|\.mpg|\.mpeg|\.mov|\.qt|\.psb|\.srt|\.ssa|\.smi|\.sub)';
129 my $docs_types = '(\.asc|\.bib|\.djvu|\.docx?|\.dot|\.dtd|\.dvi|\.gnumeric|\.mcd|\.mso|\.pdf|\.pps|\.pptx?|\.ps|\.rtf|\.sxi|\.tex|\.text|\.tm|\.xlsx?|\.xml)';
130 my $archive_types = '(\.7z|\.ace|\.bz2|\.cab|\.deb|\.dsc|\.ed2k|\.gz|\.hqx|\.md5|\.rar|\.rpm|\.sig|\.sign|\.tar|\.tbz2|\.tgz|\.vl2|\.z|\.zip|\.hdr)';
131 my $sound_types = '(\.aac|\.au|\.aud|\.m4a|\.mid|\.mp3|\.oga|\.pls|\.ram|\.raw|\.rm|\.wav|\.wma|\.xsm)';
132 my $movie_types = '(\.asf|\.ass|\.avi|\.idx|\.flv|\.m2?ts|\.mkv|\.mp4|\.mpe?g|\.mov|\.ogg|\.ogv|\.qt|\.psb|\.srt|\.ssa|\.smi|\.sub|\.webm|\.wmv)';
133133 my $winexec_types = '(\.bat|\.com|\.exe|\.dll)';
134134 my $wpad_files = '(wpad\.dat|wspad\.dat|proxy\.pac)';
135135 my $program_src = '(';
136 $program_src = $program_src.'\.bas|\.c|\.cpp|\.diff|\.f|\.h|\.init|\.m|\.mo|\.pas|\.patch|\.po|\.pot|\.py|\.sh|\.spec';
136 $program_src = $program_src.'\.bas|\.cs?|\.cpp|\.diff|\.f|\.h|\.init|\.m|\.mo|\.pas|\.patch|\.po|\.pot|\.py|\.sh|\.spec';
137137 $program_src = $program_src.'|Makefile|Makefile_c|Makefile_f77)';
138138 my $images_types = '(\.bin|\.cue|\.img|\.iso|\.run)';
139139 my $logs_types = '(\.log|_log|-log|\.logs|\.out|\.wyniki)';
140 my $fonts_types = '(\.aft|\.ttf)';
140 my $fonts_types = '(\.aft|\.otf|\.ttf|\.woff)';
141141 my $config_types = '(\.cfg|\.conf|\.config|\.ini|\.properties)';
142142 my $xpcomext_types = '(\.xpt)';
143143 my $mozext_types = '(\.xul)';
405405 for (my $i = 0; $i < @exploits; $i++) {
406406 # print "$i $exploits[$i] $field{lc_url} \n";
407407 if ( ($field{lc_url} =~ /$exploits[$i]/i) &&
408 !((defined $ignoreURLs) && ($field{url} =~ /$ignoreURLs/)) &&
408 !((defined $ignoreURLs) && ($field{url} =~ /$ignoreURLs/i)) &&
409409 !((defined $ignoreIPs) && ($field{client_ip} =~ /$ignoreIPs/)) ) {
410410 $hacks{$field{client_ip}}{$exploits[$i]}++;
411411 $total_hack_count += 1;
699699 sub shouldIgnore {
700700 my($context)=@_;
701701
702 if( ((defined $ignoreURLs) && ($field{url} =~ /$ignoreURLs/)) ||
702 if( ((defined $ignoreURLs) && ($field{url} =~ /$ignoreURLs/i)) ||
703703 ((defined $ignoreIPs) && ($field{client_ip} =~ /$ignoreIPs/)) ) {
704704 return 1;
705705 }
00
11 ##########################################################################
2 # $Id: kernel 183 2014-01-26 13:32:28Z stefjakobs $
2 # $Id: kernel 229 2014-09-09 12:12:49Z stefjakobs $
33 ##########################################################################
44 # $Log: kernel,v $
55 # Revision 1.35 2008/03/24 23:31:26 kirk
103103 # Standard boot messages
104104 next if $ThisLine =~ /Giving out device to /;
105105 $EDACs{$1}++;
106 } elsif ($ThisLine =~ /block (drbd\d+): Online verify found (\d+) \d+k block out of sync/) {
107 $DRBDErrors{$1} = $2;
106 } elsif ($ThisLine =~ /(block drbd\d+): Online verify found (\d+) \d+k block out of sync/) {
107 $DRBDErrors{$1}{"$2 block(s) out of sync"} = 1;
108 } elsif ($ThisLine =~ /(block drbd\d+): \[.*\] sock_sendmsg time expired/) {
109 $DRBDErrors{$1}{"sock_sendmsg time expired"}++;
110 } elsif ($ThisLine =~ /(block drbd\d+): Began resync as (SyncSource|SyncTarget)/) {
111 $DRBDErrors{$1}{"Began resync as $2"}++;
108112 } elsif ( ( my $errormsg ) = ( $ThisLine =~ /(.*?error.{0,17})/i ) ) {
109113 # filter out smb open/read errors cased by insufficient permissions
110114 my $SkipError = 0;
136140 $SkipError = 1 if $ThisLine =~ /smb_open: .* open failed, result=-13/;
137141 $SkipError = 1 if $ThisLine =~ /smb_open: .* open failed, error=-13/;
138142 $SkipError = 1 if $ThisLine =~ /block drbd\d+: Out of sync: start=\d+/;
143 $SkipError = 1 if $ThisLine =~ /block drbd\d+: updated( sync)? UUIDs?/i;
144 $SkipError = 1 if $ThisLine =~ /block drbd\d+: Resync done/;
145 $SkipError = 1 if $ThisLine =~ /block drbd\d+: cs:(?:Ahead|Behind) rs_left/;
146 $SkipError = 1 if $ThisLine =~ /block drbd\d+: \d+ % had equal checksums, eliminated:/;
139147 $Kernel{$ThisLine}++ if ( (! $SkipError) || ($Detail > 8)) ;
140148 }
141149 }
160168 if (keys %DRBDErrors) {
161169 print "\nWARNING: DRBD Errors Present\n";
162170 foreach my $Thisone ( sort {$a cmp $b} keys %DRBDErrors ) {
163 print " $Thisone : $DRBDErrors{$Thisone} block(s) out of sync\n";
171 foreach my $Msg (sort {$a cmp $b} keys %{$DRBDErrors{$Thisone}}) {
172 print " $Thisone: $Msg";
173 print " : $DRBDErrors{$Thisone}{$Msg} Time(s)" if $DRBDErrors{$Thisone}{$Msg} > 1;
174 print "\n";
175 }
164176 }
165177 }
166178
4040 }
4141 close(MDADM);
4242
43 foreach my $dev (@devices) {
43 DEV: foreach my $dev (@devices) {
4444 my %mdhash;
4545
46 open(MDADM,"mdadm --misc --detail $dev |");
46 open(MDADM,"mdadm --misc --detail $dev 2>&1 |");
4747 while (<MDADM>) {
48 if ($_ =~ /cannot open .*: No such file or directory/) {
49 print $_;
50 close(MDADM);
51 next DEV;
52 }
53
4854 $mdhash{'level'} = $1 if ($_ =~ /Raid Level ?: ?(.*)$/);
4955 $mdhash{'active'} = $1 if ($_ =~ /Active Devices ?: ?(.*)$/);
5056 $mdhash{'working'} = $1 if ($_ =~ /Working Devices ?: ?(.*)$/);
00 ##########################################################################
1 # $Id: named 198 2014-06-24 21:27:49Z opoplawski $
1 # $Id: named 234 2014-09-09 16:08:00Z stefjakobs $
22 ##########################################################################
3 # $Log: named,v $
4 # Revision 1.62 2011/01/06 22:53:00 stefan
5 # add: deferred zone transfers
6 # fix: TTL differs in rdataset
7 #
8 # Revision 1.61 2010/09/18 17:35:00 stefan
9 # add: bad zone transfer request
10 #
11 # Revision 1.60 2010/05/10 00:25:00 stefan
12 # fix: clients-per-query,
13 # add: more lines to ignore, refused notify, client query denied, retry
14 # limit exceeded, too many open file, no SOA, checkhints
15 #
16 # Revision 1.59.1 2010/05/04 22:25:00 stefan
17 # More refresh: and RCODE handling
18 #
19 # Revision 1.58 2009/06/02 14:55:45 mike
20 # Fedora patch from Ivan Varekova -mgt
21 #
22 # Revision 1.57 2008/03/24 23:31:26 kirk
23 # added copyright/license notice to each script
24 #
25 # Revision 1.56 2007/09/02 01:22:30 mrc
26 # - Zone notify update from Orion Poplawski
27 #
28 # Revision 1.55 2007/08/22 19:13:00 bjorn
29 # Additional filtering, including configuration and control channel errors,
30 # by Ivana Varekova.
31 #
32 # Revision 1.54 2007/08/02 05:13:49 mrc
33 # - Catch unmatched update forwarding denied, automatic empty zone, and
34 # unexpected rcode [Thanks: Orion Poplawski]
35 # - Catch unmatched shutdown failure messages
36 #
37 # Revision 1.53 2007/07/08 18:44:51 mrc
38 # Catch unmatched zone update refusals, including viewname in output [Thanks: Ã…ge Strand]
39 #
40 # Revision 1.52 2007/04/28 20:58:39 bjorn
41 # More generic RCODE handling - prints summary of unexpected DNS RCODEs.
42 #
43 # Revision 1.51 2007/04/15 20:03:25 bjorn
44 # Filtering updating zones with views, based on submittal by
45 # Jesper K. Pedersen.
46 #
47 # Revision 1.50 2007/02/16 03:36:25 bjorn
48 # Filtering some D-BUS statements, by Ivana Varekova.
49 #
50 # Revision 1.49 2007/01/29 18:28:38 bjorn
51 # Better formatting of output, by Markus Lude.
52 #
53 # Revision 1.48 2006/11/12 21:14:02 bjorn
54 # Filtering 'transfer started' message, by Russell Coker / Tom London.
55 #
56 # Revision 1.47 2006/10/20 21:02:00 bjorn
57 # Typo fixed by Alex S.
58 #
59 # Revision 1.46 2006/10/20 16:44:38 bjorn
60 # Changed regexp to handle IPV6, by Willi Mann.
61 #
62 # Revision 1.45 2006/09/15 15:40:58 bjorn
63 # Additional filtering by Ivana Varekova.
64 #
65 # Revision 1.44 2006/03/20 20:42:57 bjorn
66 # Additional filtering, by Ivana Varekova.
67 #
68 # Revision 1.43 2005/11/30 05:01:44 bjorn
69 # Don't search for info: string (for Debian), by Willi Mann.
70 #
71 # Revision 1.42 2005/11/24 16:48:30 bjorn
72 # Handles additional statements, by Ivana Varekova.
73 #
74 # Revision 1.41 2005/09/29 15:02:52 bjorn
75 # Filtering 'succeeded' by Ivana Varekova.
76 #
77 # Revision 1.40 2005/04/15 21:44:35 bjorn
78 # testing from anonymous
79 #
80 # Revision 1.39 2005/04/15 21:36:59 bjorn
81 # typo fixed in 'named' release during 2004
82 #
83 # Revision 1.38 2005/04/13 17:24:13 kirk
84 # Test change
85 #
86 # Revision 1.37 2005/02/24 17:08:04 kirk
87 # Applying consolidated patches from Mike Tremaine
88 #
89 # Revision 1.9 2005/02/21 19:09:52 mgt
90 # Bump to 5.2.8 removed some cvs logs -mgt
91 #
92 # Revision 1.8 2005/02/16 00:43:28 mgt
93 # Added #vi tag to everything, updated ignore.conf with comments, added emerge and netopia to the tree from Laurent -mgt
94 #
95 # Revision 1.7 2005/02/13 17:15:40 mgt
96 # perl -w corrections for uninit stuff -mgt
97 #
98 # Revision 1.6 2004/10/11 18:14:47 mgt
99 # update from Laurent -mgt
100 #
101 # Revision 1.41 2004/09/29 10:33:29 laurent Dufour <laurent.dufour@havas.com>
102 # Removed some ^ in regex to prevent message not being in start on line to be matched
103 # Added some check for error in named zone config file
104 # Added some check for message not being matched
105 #
106 # Revision 1.4 2004/07/29 19:33:29 mgt
107 # Chmod and removed perl call -mgt
108 #
109 # Revision 1.3 2004/07/10 01:54:35 mgt
110 # sync with kirk -mgt
111 #
112 #########################################################################
1133
1144 #####################################################
1155 ## Copyright (c) 2008 Kirk Bauer
18070 ($ThisLine =~ /Response from unexpected source/) or
18171 ($ThisLine =~ /No root nameservers for class IN/) or
18272 ($ThisLine =~ /recvfrom: No route to host/) or
183 ($ThisLine =~ /(C|c)onnection refused/) or
184 ($ThisLine =~ /lame server resolving/) or
18573 ($ThisLine =~ /transfer of/) or
18674 ($ThisLine =~ /using \d+ CPU/) or
18775 ($ThisLine =~ /loading configuration/) or
255143 ($ThisLine =~ /corporation. Support and training for BIND \d+ are/) or
256144 ($ThisLine =~ /available at https:\/\/www.isc.org\/support/) or
257145 ($ThisLine =~ /----------------------------------------------------/) or
146 ($ThisLine =~ /next key event: /) or
147 ($ThisLine =~ /reconfiguring zone keys/) or
148 ($ThisLine =~ /using built-in DLV key/) or
149 ($ThisLine =~ /reading built-in trusted keys from file/) or
150 ($ThisLine =~ /all zones loaded/) or
258151 # ignore this line because the following line describes the error
259152 ($ThisLine =~ /unexpected error/)
260153 ) {
297190 $ZoneExpired{$Zone}++;
298191 } elsif ( ($Zone) = ( $ThisLine =~ /zone (.+)\: loaded serial/ ) ) {
299192 $ZoneLoaded{$Zone}++;
193 } elsif ( (undef,$Addr,$Server) = ( $ThisLine =~ /(C|c)onnection refused\)? resolving '(.+)': (.+)/ ) ) {
194 $ConnectionRefused{$Addr}{$Server}++;
300195 } elsif ( (undef,$Addr,undef,$Server) = ( $ThisLine =~ /ame server (on|resolving) '(.+)' \(in .+\):\s+(\[.+\]\.\d+)?\s*'?(.+)'?:?/ ) ) {
301 $LameServer{"$Addr ($Server)"}++;
196 $LameServer{$Addr}{$Server}++;
302197 } elsif ( ($Zone) = ( $ThisLine =~ /Zone \"(.+)\" was removed/ ) ) {
303198 $ZoneRemoved{$Zone}++;
304199 } elsif ( ($Zone) = ( $ThisLine =~ /received notify for zone '(.*)'/ ) ) {
392287 $NoSOA{$Client}++;
393288 } elsif (($Hint) = ($ThisLine =~ /checkhints: (.*)/) ) {
394289 $Hints{$Hint}++;
290 } elsif ($ThisLine =~ /^samba_dlz:/) {
291 if ( ($Rhost, $Error) = ($ThisLine =~ /disallowing update of signer=.* name=(.*) type=.* error=(.*)/ )) {
292 $UpdateDenied{"$Rhost ($Error)"}++;
293 }
294 # ignore rest of samba4 dlz entries for now
395295 } else {
396296 # Report any unmatched entries...
397297 # remove PID from named messages
542442 }
543443 }
544444
445 if ( ( $Detail >= 10 ) and (keys %ConnectionRefused) ) {
446 print "\nConnection refused resolving:\n";
447 foreach $Addr (sort keys %ConnectionRefused) {
448 print " $Addr:\n";
449 foreach $Server (sort SortIP keys %{$ConnectionRefused{$Addr}}) {
450 print " $Server: $ConnectionRefused{$Addr}{$Server} Time(s)\n";
451 }
452 }
453 }
454
545455 if ( ( $Detail >= 10 ) and (keys %LameServer) ) {
546456 print "\nThese addresses had lame server references:\n";
547 foreach $ThisOne (keys %LameServer) {
548 print " $ThisOne: $LameServer{$ThisOne} Time(s)\n";
457 foreach $Addr (sort keys %LameServer) {
458 print " $Addr:\n";
459 foreach $Server (sort SortIP keys %{$LameServer{$Addr}}) {
460 print " $Server: $LameServer{$Addr}{$Server} Time(s)\n";
461 }
549462 }
550463 }
551464
00 use strict;
11 ##########################################################################
2 # $Id: pam_unix 164 2013-08-19 10:22:38Z stefjakobs $
2 # $Id: pam_unix 215 2014-09-08 20:45:36Z stefjakobs $
33 ##########################################################################
44 # $Log: pam_unix,v $
55 # Revision 1.36 2011/01/05 22:01:00 stefan
170170 } elsif ($line =~ s/^session opened for user (.+) by LOGIN\(uid=\d+\)/$1/) {
171171 $data{$service}{'Sessions Opened'}{$line}++;
172172 } elsif ($line =~ /session closed for user/) {
173 # ignore this line
173 } elsif ($line =~ /^service\(sshd\) ignoring max retries/) {
174 # ignore these lines
174175 } elsif ($line =~ s/^authentication failure; .*rhost=(\S*)\s+user=(\S*)$/$2 ($1)/) {
175176 $data{$service}{'Authentication Failures'}{$line}++;
176177 } elsif ($line =~ s/^authentication failure; .*rhost=(\S*)\s*$/unknown ($1)/) {
181182 $data{$service}{'Authentication Failures'}{$line}++;
182183 } elsif ($line =~ s/^(\d+) more authentication failures?; .*rhost=(\S*)\s+user=(\S*)$/$3 ($2)/) {
183184 $data{$service}{'Authentication Failures'}{$line} += $1;
184 } elsif ($line =~ s/^(\d+) more authentication failures?; .*rhost=(\S*)$/unknown ($2)/) {
185 } elsif ($line =~ s/^(\d+) more authentication failures?; .*rhost=(\S*)\s*$/unknown ($2)/) {
185186 $data{$service}{'Authentication Failures'}{$line} += $1;
186187 } elsif ($line =~ /check pass; user unknown/) {
187188 $data{$service}{'Invalid Users'}{'Unknown Account'}++;
5454 no warnings "uninitialized";
5555 use re 'taint';
5656
57 our $Version = '1.40.00';
57 our $Version = '1.40.03';
5858 our $progname_prefix = 'postfix';
5959
6060 # Specifies the default configuration file for use in standalone mode.
35853585 }
35863586
35873587 # Client TLS messages
3588 elsif ( ($status,$host,$type) = ($p1 =~ /^(?:(Verified|Trusted|Untrusted) )?TLS connection established to ([^ ]*): (.*)$/o)) {
3588 elsif ( ($status,$host,$type) = ($p1 =~ /^(?:(Verified|Trusted|Untrusted|Anonymous) )?TLS connection established to ([^ ]*): (.*)$/o)) {
35893589 #TD TLS connection established to example.com: TLSv1 with cipher AES256-SHA (256/256 bits)
35903590 # Postfix 2.5+: peer verification status: Untrusted, Trusted or Verified when
35913591 # server's trust chain is valid and peername is matched
39303930 push @ignore_list, qr/^report recipient to all milters /;
39313931 push @ignore_list, qr/_action = defer_if_permit$/;
39323932 push @ignore_list, qr/^reject_invalid_hostname: /;
3933 push @ignore_list, qr/^cfg_get_/;
3934 push @ignore_list, qr/^sacl_check: /;
39333935
39343936 # non-anchored
39353937 #push @ignore_list, qr/: Greylisted for /;
47374739 #TDsd warning: Read failed in network_biopair_interop with errno=0: num_read=0, want_read=11
47384740 #TDs warning: Read failed in network_biopair_interop with errno=0: num_read=0, want_read=11
47394741 $warning =~ s/^(Read failed in network_biopair_interop) with .*$/$1/;
4742
4743 =cut
4744 $warning =~ s/^(TLS library problem: )\d+:(error:.*)$/$1$2/;
4745 $warning =~ s/^(network_biopair_interop: error reading) \d+ bytes(.*)$/$1$2/;
4746
4747 1 TLS library problem: 10212:error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher...
4748 1 TLS library problem: 10217:error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher...
4749 1 network_biopair_interop: error reading 1102 bytes from the network: Connection reset by peer
4750 1 network_biopair_interop: error reading 1120 bytes from the network: Connection reset by peer
4751 =cut
4752
47404753
47414754 $Totals{'warningsother'}++; return unless ($Collecting{'warningsother'});
47424755 $Counts{'warningsother'}{$warning}++;
00 #########################################################################
1 # $Id: secure 189 2014-02-07 13:56:36Z stefjakobs $
1 # $Id: secure 231 2014-09-09 12:59:24Z stefjakobs $
22 ##########################################################################
33 # $Log: secure,v $
44 # Revision 1.86 2009/11/14 16:26:41 kirk
350350 } elsif ( ($Service,undef,$Name,$IP) = ($ThisLine =~ /^([^ ]+)\[\d+\]: warning: ([^ ]+), line \d+: host name\/name mismatch: ([^ ]+) != ([^ ]+)$/) ) {
351351 $NameVerifyFail{$Service}{"$Name != $IP"}++;
352352 } elsif ( ($Display, $User) = ($ThisLine =~ /^xscreensaver\[\d+\]: FAILED LOGIN \d ON DISPLAY \"([^ ]+)\", FOR \"([^ ]+)\"$/) ) {
353 $FailedSaver{$User}{$Display}++;
353 $FailedSaver->{$User}->{$Display}++;
354354 } elsif ( $ThisLine =~ s/^([^ ]+)\[\d+\]: warning: can\'t get client address: No route to host$/$1/ ) {
355355 $NoIP->{$ThisLine}++;
356356 } elsif ( $ThisLine =~ s/^([^ ]+)\[\d+\]: warning: can\'t get client address: Network is unreachable$/$1/ ) {
687687 print "\nFailed screensaver disable:\n";
688688 foreach $User (sort {$a cmp $b} keys %{$FailedSaver}) {
689689 print " User $User on displays:\n";
690 foreach $Display (sort {$a cmp $b} keys %{$FailedSaver{$User}}) {
691 print " $Display : $FailedSaver{$User}{$Display} Time(s)\n";
690 foreach $Display (sort {$a cmp $b} keys %{$FailedSaver->{$User}}) {
691 print " $Display : " . $FailedSaver->{$User}->{$Display} . " Time(s)\n";
692692 }
693693 }
694694 }
00
11 ##########################################################################
2 # $Id: sendmail 150 2013-06-18 22:19:38Z mtremaine $
2 # $Id: sendmail 220 2014-09-09 09:35:36Z stefjakobs $
33 ##########################################################################
44 # $Log: sendmail,v $
55 # Revision 1.97 2008/03/24 23:31:26 kirk
904904 } elsif ($ThisLine=~ /^headers too large .* from (.*) during message collect$/) {
905905 $LargeHdrs{$1}++;
906906 # file=srvrsmtp.c, LogLevel>5, LOG_INFO
907 } elsif ($ThisLine=~ /(\S*) ?\[([0-9\.]+)\](?: \(may be forged\))?: (\S+) (\S+) \[rejected\]/i) {
908 chomp($Host=$2." ". (defined($1) ? "(".$1.")" : "(unresolved)") );
909 $Luser=$4;
910 $RejCmd=uc $3;
907 } elsif ($ThisLine=~ /(\S*) ?\[(IPv6:)?([0-9A-F\.:]+)\](?: \(may be forged\))?: (\S+) (\S+) \[rejected\]/i) {
908 chomp($Host=$3." ". (defined($1) ? "(".$1.")" : "(unresolved)") );
909 $Luser=$5;
910 $RejCmd=uc $4;
911911 $Abuse{$Host}{$Luser}{$RejCmd}++;
912912 # file=srvrsmtp.c, LogLevel>5, LOG_INFO
913 } elsif ( $ThisLine =~ /\[([0-9\.]+)]: ETRN (\S+)/ ) {
914 chomp($ETRN=$2." from ".$1);
913 } elsif ( $ThisLine =~ /\[(IPv6:)?([0-9A-F\.:]+)]: ETRN (\S+)/i ) {
914 chomp($ETRN=$3." from ".$2);
915915 $ETRNs{$ETRN}++;
916916 # file=conf.c, LogLevel>8, LOG_NOTICE
917917 } elsif ( $ThisLine =~ /rejecting connections on daemon [^ ]+: load average: ([0-9]+)/ ) {
00
11 ##########################################################################
2 # $Id: smartd 182 2014-01-26 12:46:02Z stefjakobs $
3 ##########################################################################
4 # $Log: smartd,v $
5 # Revision 1.26 2009/06/02 15:01:34 mike
6 # Fedora patch from Ivan Varekova -mgt
7 #
8 # Revision 1.25 2008/12/09 18:24:24 mike
9 # Patch from Stefan Jakobs for new smartd with SATA support -mgt
10 #
11 # Revision 1.24 2008/06/30 20:47:20 kirk
12 # fixed copyright holders for files where I know who they should be
13 #
14 # Revision 1.23 2008/03/24 23:31:27 kirk
15 # added copyright/license notice to each script
16 #
17 # Revision 1.22 2008/01/16 20:22:38 bjorn
18 # Makes reporting of SCSI and IDE uniform, by Tom Shield.
19 #
2 # $Id: smartd 239 2014-09-16 20:14:12Z opoplawski $
203 ##########################################################################
214
225 #######################################################
6043 my %UnavailableDev = ();
6144 my %SataDisk = ();
6245 my %CheckFailed = ();
46 my %Monitoring = ();
47 my %DeviceInfo = ();
6348
6449 my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
6550 my $IgnoreUnmatched = $ENV{'smartd_ignore_unmatched'} || 0;
6853 chomp($ThisLine);
6954 if ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), No such device(?: or address)?, open\(\) failed/ )) {
7055 # ignore
71 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), is SMART capable. Adding to "monitor" list./ )) {
56 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), open\(\) failed: No such device(?: or address)?/ )) {
7257 # ignore
7358 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), found in smartd database./ )) {
7459 # ignore
9883 # ignore
9984 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^# *[0-9]+ Offline *Fatal or unknown error/ )) {
10085 # ignore
101 } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not capable of SMART self-check/ )) {
86 } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not capable of SMART (Health Status |self-)check/ )) {
10287 # ignore
10388 } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), is in STANDBY mode, skipping checks/ )) {
10489 # ignore
115100 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^ *$/ )) {
116101 # ignore empty lines
117102 } elsif ( ($ThisLine =~ /^smartd version/)
118 || ($ThisLine =~ /^Home page/)
119 || ($ThisLine =~ /^smartd .*Copyright \(C\) [0-9-]+ by Bruce Allen/)
120 || ($ThisLine =~ /configuration file/i)
121 || ($ThisLine =~ /\[trip Temperature is \d+ Celsius\]/)
122 || ($ThisLine =~ /^Monitoring/)
123 || ($ThisLine =~ /smartd received signal 15: Terminated/)
124 || ($ThisLine =~ /smartd is exiting \(exit status 0\)/)
125 || ($ThisLine =~ /smartd has fork/)
126 || ($ThisLine =~ /smartd (startup|shutdown) succeeded/)
127 || ($ThisLine =~ /Unable to register device (.*) \(no Directive -d removable\). Exiting/)
128 || ($ThisLine =~ /Device (.*), SATA disks accessed via libata are not currently supported by smartmontools./)
129 || ($ThisLine =~ /Device: (.*), IE \(SMART\) not enabled, skip device Try '.*' to turn on SMART features/)
130 || ($ThisLine =~ /Device: (.*), Bad IEC (SMART) mode page, err=-5, skip device/)
131 || ($ThisLine =~ /Drive: DEVICESCAN, implied '-a' Directive on line [\d]+ of file/)
132 || ($ThisLine =~ /packet devices \[this device CD\/DVD\] not SMART capable/)
133 || ($ThisLine =~ /System clock time adjusted to the past/) )
103 || ($ThisLine =~ /^smartd [0-9.]+ [0-9-]+ r[0-9]+ \[.*\]/)
104 || ($ThisLine =~ /^Home page/)
105 || ($ThisLine =~ /Copyright \(C\) [0-9-]+(?: by|,) Bruce Allen/)
106 || ($ThisLine =~ /configuration file/i)
107 || ($ThisLine =~ /\[trip Temperature is \d+ Celsius\]/)
108 || ($ThisLine =~ /^Monitoring/)
109 || ($ThisLine =~ /smartd received signal 15: Terminated/)
110 || ($ThisLine =~ /smartd is exiting \(exit status 0\)/)
111 || ($ThisLine =~ /smartd has fork/)
112 || ($ThisLine =~ /smartd (startup|shutdown) succeeded/)
113 || ($ThisLine =~ /Unable to register device (.*) \(no Directive -d removable\). Exiting/)
114 || ($ThisLine =~ /Device (.*), SATA disks accessed via libata are not currently supported by smartmontools./)
115 || ($ThisLine =~ /Device: (.*), IE \(SMART\) not enabled, skip device/)
116 || ($ThisLine =~ /^Try '.*' to turn on SMART features/)
117 || ($ThisLine =~ /Device: (.*), Bad IEC (SMART) mode page, err=-5, skip device/)
118 || ($ThisLine =~ /Drive: DEVICESCAN, implied '-a' Directive on line [\d]+ of file/)
119 || ($ThisLine =~ /packet devices \[this device CD\/DVD\] not SMART capable/)
120 || ($ThisLine =~ /System clock time adjusted to the past/) )
134121 {
135122 # ignore
136123
124 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), is SMART capable. Adding to "monitor" list./ )) {
125 $Monitoring{$Device} = 1;
126 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), ([^,]+, S\/N:[^,]+,.* FW:.*)/ )) {
127 $DeviceInfo{$Device} = $Msg;
128 } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), (\[[^,]+, lu id: .*)/ )) {
129 $DeviceInfo{$Device} = $Msg;
137130 # } elsif ( ($Device,$Msg) = ($ThisLine =~ /^Device: ([^,]+), (.*)$/)) {
138131 # $ParamChanges{$Device}{$Msg}++;
139132 } elsif ( ($Device) = ($ThisLine =~ /^Device: ([^,]+), not found in smartd database./ )) {
140133 $NotInDatabase{$Device}++;
141 } elsif ( my ($Device,$AttribType,$Code,$Name,undef,undef,undef,$RawVal) = ($ThisLine =~ /^Device: ([^,]+), SMART ([A-Za-z]+) Attribute: ([0-9]+) (Temperature_Celsius) changed from ([0-9]+) (\[Raw [0-9]+\]) to ([0-9]+) \[Raw ([0-9]+)\]/)) {
134 } elsif ( my ($Device,$AttribType,$Code,$Name,undef,undef,undef,$RawVal) = ($ThisLine =~ /^Device: ([^,]+), SMART ([A-Za-z]+) Attribute: ([0-9]+) (Temperature_Celsius) changed from ([0-9]+) (\[Raw [0-9]+(?: \([0-9]+\s[0-9]+\s[0-9]+\s[0-9]+(?:\s[0-9])?\))?\]) to ([0-9]+) \[Raw ([0-9]+)(?: \([0-9]+\s[0-9]+\s[0-9]+\s[0-9]+(?:\s[0-9])?\))?\]/)) {
142135 push @{$TempChanges{$Device}}, $RawVal;
143136 # smartd reports temperature changes this way only for SCSI disks
144137 } elsif ( my ($Device,$AttribType,$Code,$Name,undef,undef,$NewVal) = ($ThisLine =~ /^Device: ([^,]+), SMART ([A-Za-z]+) Attribute: ([0-9]+) ([A-Za-z_]+) changed from ([0-9]+) (\[Raw [0-9]+\] )?to ([0-9]+)/)) {
215208 }
216209
217210 if (keys %CantMonitor) {
218 foreach my $Device (sort keys %ParamChanges) {
211 foreach my $Device (sort keys %CantMonitor) {
219212 print "\n$Device :\n";
220213 foreach my $Line (sort keys %{$CantMonitor{$Device}}) {
221214 print " $Line - " . $CantMonitor{$Device}{$Line} . " Time(s)\n";
359352 print "\n";
360353 }
361354
355 if (keys %Monitoring and $Detail > 7) {
356 print "\nMonitoring:\n";
357 foreach my $Device (sort keys %Monitoring) {
358 print "\t$Device";
359 if (defined($DeviceInfo{$Device})) {
360 print ": $DeviceInfo{$Device}\n";
361 } else {
362 print "\n";
363 }
364 }
365 }
366
362367 if ((%OtherList) and (not $IgnoreUnmatched)){
363368 print "\n**Unmatched Entries**\n";
364369 foreach my $line (sort keys %OtherList) {
00 ##########################################################################
1 # $Id: sshd 174 2013-11-08 17:01:58Z opoplawski $
1 # $Id: sshd 240 2014-09-22 12:55:12Z stefjakobs $
22 ##########################################################################
33 # $Log: sshd,v $
44 # Revision 1.79 2011/01/05 10:49:03 stefan
261261 ($ThisLine =~ m/^Disconnecting: server_input_channel_req: unknown channel -?\d+/) or
262262 ($ThisLine =~ m/^connect from \d+\.\d+\.\d+\.\d+/) or
263263 ($ThisLine =~ m/^fatal: Timeout before authentication/ ) or
264 ($ThisLine =~ m/^fatal: no hostkey alg/) or
264265 ($ThisLine =~ m/Connection from .* port /) or
265266 ($ThisLine =~ m/Postponed (keyboard-interactive|publickey) for [^ ]+ from [^ ]+/) or
266267 ($ThisLine =~ m/Read from socket failed/) or
287288 ($ThisLine =~ /pam_winbind\(sshd:account\): user .* OK/) or
288289 ($ThisLine =~ /pam_systemd\(sshd:session\): Moving/) or
289290 ($ThisLine =~ /PAM \d+ more authentication failures?;/) or
291 ($ThisLine =~ /^PAM service\(sshd\) ignoring max retries;/) or
290292 ($ThisLine =~ /^Failed keyboard-interactive for <invalid username> from/ ) or
291293 ($ThisLine =~ /^Keyboard-interactive \(PAM\) userauth failed/ ) or
292294 ($ThisLine =~ /^debug1: /) or
321323 ($ThisLine =~ m/^fatal: Read from socket failed: No route to host/) or
322324 ($ThisLine =~ m/^fatal: Write failed: Network is unreachable/ ) or
323325 ($ThisLine =~ m/^fatal: Write failed: Broken pipe/) or
326 ($ThisLine =~ m/^fatal: Write failed: Connection reset by peer/) or
324327 ($ThisLine =~ m/^channel \d+: open failed: (?:connect failed: Channel open failed\.|administratively prohibited: open failed)/) or
325328 ($ThisLine =~ m/^session_input_channel_req: no session \d+ req window-change/) or
326329 ($ThisLine =~ m/^error: chan_shutdown_read failed for .+/)
380383 } elsif ( my ($Reason) = ($ThisLine =~ /^Authentication refused: (.*)$/ ) ) {
381384 $RefusedAuthentication{$Reason}++;
382385 } elsif ( my ($Host,$Reason) = ($ThisLine =~ /^Received disconnect from ([^ ]*): (.*)$/)) {
383 $DisconnectReceived{$Reason}{$Host}++;
386 # Reason 11 (SSH_DISCONNECT_BY_APPLICATION) is expected, and logged at severity level INFO
387 if ($Reason != 11) {$DisconnectReceived{$Reason}{$Host}++;}
384388 } elsif ( my ($Host) = ($ThisLine =~ /^ROOT LOGIN REFUSED FROM ([^ ]*)$/)) {
385389 $RootLogin{$Host}++;
386390 } elsif ( my ($Error) = ($ThisLine =~ /^Cannot release PAM authentication\[\d\]: (.*)$/)) {
0 #!/usr/bin/perl
01
12 ##########################################################################
2 # $Id: stunnel 167 2013-08-19 10:28:43Z stefjakobs $
3 # $Id: stunnel 238 2014-09-16 08:00:55Z stefjakobs $
34 ##########################################################################
45
56 #######################################################
2324
2425 my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
2526 my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
26 my $allowedServicesInput = $ENV{'stunnel_allowed_services'} || "";
2727
2828 my $DebugCounter = 0;
29 my $Top = $ENV{'stunnel_print_top'} || 20;
2930
3031 if ( $Debug >= 5 ) {
3132 print STDERR "\n\nDEBUG: Inside stunnel Filter \n\n";
3536 my @OtherList = ();
3637 my %OtherList = ();
3738 my %connections = ();
38 my %connectionsAllowed = ();
39 my %log_connections = ();
4039 my %versioninfo = ();
40 my %errors = ();
41 my %notices = ();
4142 my $sockdata = 0;
4243 my $ssldata = 0;
43
44 $allowedServicesInput =~ s/[\t ]*,[\t ]*/,/g;
45 my %allowedServices = ();
46 @allowedServices{split(/,/, $allowedServicesInput)} = ();
47
48 if ($Debug >= 5) {
49 print "Allowed services are set to: \n";
50 foreach my $allowedService (sort keys %allowedServices) {
51 print $allowedService, "\n";
52 }
53 print "\n\n\n";
54 }
5544
5645 sub other {
5746 my $msg = shift;
6554
6655 my $ThisLine;
6756 while (defined($ThisLine = <STDIN>)) {
57 $ThisLine =~ s/LOG\d\[\d{1,5}:\d{15}\]: (.*)/$1/;
6858 if ( $Debug >= 5 ) {
6959 print STDERR "DEBUG($DebugCounter): $ThisLine";
7060 $DebugCounter++;
7161 }
7262 chomp($ThisLine);
73 my ($logid) = ($ThisLine =~ /^LOG\d\[(\d+:\d+)\]:/);
74 # remove leading log level and ID, eg 'LOG5[2411:3084352400]: '
75 $ThisLine =~ s/^LOG\d\[\d+:\d+\]: //;
76
77 if ( ($ThisLine =~ m/^SSL_read: Connection reset by peer/)
78 ) {
79 # ignore
80 } elsif ($ThisLine =~ m/^(.+) connected from (\d+\.\d+\.\d+\.\d+)/) {
63 my $origline = $ThisLine;
64 if ($ThisLine =~ m/^(.+) connected from (\d+\.\d+\.\d+\.\d+)/) {
8165 my $service = $1;
8266 my $ip = $2;
83 if (exists($allowedServices{$service})) {
84 ++$connectionsAllowed{$service};
85 } else {
86 ++$connections{$service}{$ip};
67 if (! exists($connections{$service}{$ip})) {
68 $connections{$service}{$ip} = 0;
8769 }
88 } elsif ($ThisLine =~ m/^stunnel accepted connection from (\d+\.\d+\.\d+\.\d+):\d+/) {
89 $log_connections{$logid}{client} = $1;
90 } elsif ($ThisLine =~ m/^stunnel connected remote server from (\d+\.\d+\.\d+\.\d+):\d+/) {
91 $log_connections{$logid}{source} = $1;
92 } elsif ($ThisLine =~ m/^connect_blocking: connected (\d+\.\d+\.\d+\.\d+:\d+)/) {
93 $log_connections{$logid}{service} = $1;
70 ++$connections{$service}{$ip};
9471 } elsif ($ThisLine =~ m/^Connection (reset|closed): (\d+) bytes sent to SSL, (\d+) bytes sent to socket/) {
9572 $ssldata += $2;
9673 $sockdata += $3;
9774 } elsif ($ThisLine =~ m/^Connection (reset|closed)/) {
9875 # ignore
99 } elsif ($ThisLine =~ m/^Threading:[\w]+ SSL:[\w]+/) {
76 } elsif ($ThisLine =~ m/^connect_blocking: connected/) {
10077 # ignore
101 } elsif ($ThisLine =~ m/^stunnel [\d\.]+ on [\w\-]+([\w\+\s]+)?with OpenSSL [\w\.\-]+ \d+ \w+ \d+/) {
78 } elsif ($ThisLine =~ m/^Log file reopened$/) {
79 # ignore
80 } elsif ($ThisLine =~ m/^SSL socket closed on SSL_read with \d+ byte\(s\) in buffer$/) {
81 # ignore
82 } elsif ($ThisLine =~ m/^stunnel [\d\.]+ on [\w\-]+ [\w\+]+ with OpenSSL [\w\.]+ \d+ \w+ \d+/) {
10283 $versioninfo{$ThisLine} = 1;
84 } elsif ($ThisLine =~ m/^Service (\S+) accepted connection from ([0-9a-fA-F.:]+):\d{1,5}/) {
85 $connections{$1}{$2}++;
86 } elsif ($ThisLine =~ m/^Service (\S+) connected remote server from ([0-9a-fA-F.:]+):\d{1,5}/) {
87 $connections{"remote: $1"}{$2}++;
88 } elsif ($ThisLine =~ m/^Error detected on (SSL|socket) \((read|write)\) file descriptor: (.*) \(\d+\)/) {
89 $errors{"$1 $2 file descriptor: $3"}++;
90 } elsif ($ThisLine =~ m/^transfer: s_poll_wait: TIMEOUTclose exceeded: closing$/) {
91 $notices{"TIMEOUTclose exceeded: closing connection"}++;
92 } elsif ($ThisLine =~ m/^(SSL_(?:accept|read|shutdown): .*|getpeerbyname: .*)(?: \(\d+\))?$/) {
93 $notices{$1}++;
10394 } else {
10495 # Report any unmatched entries...
10596 other($ThisLine);
10697 }
10798 }
10899
109 if (keys %log_connections) {
110 foreach my $entry (keys %log_connections) {
111 my $ip = $log_connections{$entry}{client};
112 my $service = $log_connections{$entry}{service};
113 $service = "Unknown" if not $service;
114 $connections{$service}{$ip}++;
100 if (keys %errors) {
101 print "\nErrors:\n";
102 foreach my $e (sort keys %errors) {
103 printf " %-50s %6d time(s)\n", $e, $errors{$e};
104 }
105 }
106
107 if (keys %notices) {
108 print "\nNotices:\n";
109 foreach my $n (sort keys %notices) {
110 printf " %-50s %6d time(s)\n", $n, $notices{$n};
115111 }
116112 }
117113
118114 if (keys %connections) {
119 print "Number of connections per service per ip:\n\n";
115 print "\nconnections:\n";
120116 foreach my $service (sort keys %connections) {
121 printf " To %s\n", $service;
117 print " $service\n";
122118 my $ips = $connections{$service};
123 foreach my $ip (sort keys %$ips) {
124 printf " %15s : %5d time(s)\n", $ip, $ips->{$ip};
119 my $i = 0;
120 foreach my $ip (sort {$connections{$service}{$b} <=> $connections{$service}{$a}} keys %{$connections{$service}}) {
121 if ($i >= $Top) {
122 printf " %-48s\n", "... only top $Top printed ...";
123 last;
124 } else {
125 printf " %-48s %6d time(s)\n", $ip, $connections{$service}{$ip};
126 $i++;
127 }
125128 }
126129 }
127130 }
128131
129 if (keys %connectionsAllowed) {
130 print "\nNumber of connections per allowed service:\n";
131 foreach my $service (sort keys %connectionsAllowed) {
132 printf " %18s : %5d time(s)\n", $service, $connectionsAllowed{$service};
132 if ($sockdata > 0) {
133 if ($sockdata > 1024*1024) {
134 printf "\n%-48s %10.2f MB\n", "amount of socket data transferred:", $sockdata / 1024 / 1024;
135 } else {
136 printf "\n%-48s %10.2f KB\n", "amount of socket data transferred:", $sockdata / 1024;
133137 }
134138 }
135139
136 if ($sockdata > 0) {
137 printf "\namount of socket data transferred: %.2f KB\n", $sockdata / 1024;
138 }
139
140140 if ($ssldata > 0) {
141 printf "\namount of SSL data transferred: %.2f KB\n", $ssldata / 1024;
141 if ($ssldata > 1024*1024) {
142 printf "\n%-48s %10.2f MB\n", "amount of SSL data transferred:", $ssldata / 1024 / 1024;
143 } else {
144 printf "\n%-48s %10.2f KB\n", "amount of SSL data transferred:", $ssldata / 1024;
145 }
142146 }
143147
144148 if (keys %versioninfo) {
00
11 ##########################################################################
2 # $Id: xntpd 150 2013-06-18 22:19:38Z mtremaine $
3 ##########################################################################
4 # $Log: xntpd,v $
5 # Revision 1.23 2010/05/05 12:30:51 stefan
6 # added: Operation not permitted, fixed: typo in Errors
7 #
8 # Revision 1.22 2008/06/30 23:07:51 kirk
9 # fixed copyright holders for files where I know who they should be
10 #
11 # Revision 1.21 2008/05/14 18:22:21 mike
12 # Interfaces numbers can be greater then 9 -mgt
13 #
14 # Revision 1.20 2008/05/13 16:04:48 mike
15 # Patch from David Baldwin -mgt
16 #
17 # Revision 1.19 2008/05/04 15:26:08 mike
18 # Patch from Fedora tree -mgt
19 #
20 # Revision 1.18 2008/03/24 23:31:27 kirk
21 # added copyright/license notice to each script
22 #
23 # Revision 1.17 2007/05/24 03:59:42 kirk
24 # http://bugs.gentoo.org/show_bug.cgi?id=141649
25 #
26 # Revision 1.16 2007/04/16 03:11:11 bjorn
27 # Modified filtering for Listening entries to accommodate interface numbers.
28 #
29 # Revision 1.15 2007/04/16 02:34:27 bjorn
30 # Filtering Listening...Disabled statements.
31 #
32 # Revision 1.14 2007/02/17 19:36:11 bjorn
33 # Reverting back to version 1.12 - ignore changes to 1.13.
34 #
35 # Revision 1.13 2007/02/17 16:28:44 bjorn
36 # Deleted superfluous lines - probably from malformed diff.
37 #
38 # Revision 1.12 2007/02/16 03:57:50 bjorn
39 # Additional filtering, by Ivana Varekova.
40 #
41 # Revision 1.11 2005/11/01 15:01:40 bjorn
42 # Adjustment to synchronized messages in Solaris, by David Baldwin
43 #
44 # Revision 1.10 2005/10/19 05:45:12 bjorn
45 # Filtering redundant failed message, by David Baldwin
46 #
47 # Revision 1.9 2005/10/19 05:35:30 bjorn
48 # Code cleanup, better handling of Unmatched, and additional filtering, by
49 # David Baldwin
50 #
51 # Revision 1.8 2005/10/02 15:00:34 bjorn
52 # Corrections to last commit
53 #
54 # Revision 1.7 2005/10/01 18:30:12 bjorn
55 # Added filtering for listening and synchronized statements, by Gilles Detillieux
56 #
57 # Revision 1.6 2005/09/28 17:39:04 mike
58 # Patch from David Baldwin, plus a few other tweaks -mgt
59 #
60 # Revision 1.5 2005/07/05 22:16:23 mike
61 # Small patch from Paul Chambers -mgt
62 #
63 # Revision 1.4 2005/05/23 17:35:55 bjorn
64 # Patch for an older ntpd (4.1.1a-9), by Michael Evans
65 #
66 # Revision 1.3 2005/05/04 15:52:51 bjorn
67 # Removed shell path to perl in first line
68 #
69 # Revision 1.2 2005/02/24 17:08:05 kirk
70 # Applying consolidated patches from Mike Tremaine
71 #
72 # Revision 1.2 2005/02/16 00:43:28 mgt
73 # Added #vi tag to everything, updated ignore.conf with comments, added emerge and netopia to the tree from Laurent -mgt
74 #
75 # Revision 1.1 2005/02/13 01:25:13 mgt
76 # Inital code check in from David Baldwin -mgt
77 #
2 # $Id: xntpd 228 2014-09-09 11:27:00Z stefjakobs $
783 ##########################################################################
794
805 ########################################################
15378 ($ThisLine =~ /Listening on interface .* Disabled/) or
15479 ($ThisLine =~ /Listen and drop on /) or
15580 ($ThisLine =~ /Listening on routing socket on/) or
156 ($ThisLine =~ /ntp_io: estimated max descriptors: \d*, initial socket boundary: \d*/) or
157 ($ThisLine =~ /peers refreshed$/) or
158 ($ThisLine =~ /restrict: error in address/) or
159 ($ThisLine =~ /syntax error in .+ line \d+, column \d+$/)
81 ($ThisLine =~ /ntp_io: estimated max descriptors: \d*, initial socket boundary: \d*/) or
82 ($ThisLine =~ /peers refreshed$/) or
83 ($ThisLine =~ /restrict: error in address/) or
84 ($ThisLine =~ /syntax error in .+ line \d+, column \d+$/)
16085 ) {
16186 # Ignore these
16287 } elsif ($ThisLine =~ m/ntpd [\d\-\.\w@]+ ... ... .. ..:..:.. /) {