annotate common/logwatch/systemd @ 482:d83de9b3a62b default tip

Update hiera.yaml within Puppet config Forgot that we manage it from here. Now has content to match new packages
author IBBoard <dev@ibboard.co.uk>
date Fri, 30 Aug 2024 16:10:36 +0100
parents 85a5a231b0b5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
1 ########################################################
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
2 # Please file all bug reports, patches, and feature
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
3 # requests under:
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
4 # https://sourceforge.net/p/logwatch/_list/tickets
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
5 # Help requests and discusion can be filed under:
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
6 # https://sourceforge.net/p/logwatch/discussion/
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
7 ########################################################
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
8
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 ########################################################
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 ## Copyright (c) 2016 Orion Poplawski
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 ## Covered under the included MIT/X-Consortium License:
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 ## http://www.opensource.org/licenses/mit-license.php
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 ## All modifications and contributions by other persons to
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 ## this script are assumed to have been donated to the
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 ## Logwatch project and thus assume the above copyright
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 ## and licensing terms. If you want to make contributions
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 ## under your own copyright or a different license this
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 ## must be explicitly stated in the contribution an the
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 ## Logwatch project reserves the right to not accept such
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 ## contributions. If you have made significant
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 ## contributions to this script and want to claim
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 ## copyright please contact logwatch-devel@lists.sourceforge.net.
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 #########################################################
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 use strict;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
27 my $Ignore_failed = $ENV{'ignore_failed'} || "";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
28 my $Ignore_leftover = $ENV{'ignore_leftover'} || "";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
29 my %ConfigError;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 my %Activated;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 my %Failed;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
32 my %Deactivated;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
33 my %LeftOver;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 my $Reexecuted = 0;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 my %Reloaded;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
36 my %Skipped;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 my %Slice;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
38 my %Slow;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 my %Started;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 my %Target;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 my $TimeChanged = 0;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 my $LastTarget;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 my %UserSession;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 my %OtherList;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
46 # Failure will generate multiple messages like:
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 # Feb 5 16:37:50 hostname systemd: ansible-pull.service: main process exited, code=exited, status=2/INVALIDARGUMENT
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 # Feb 5 16:37:50 hostname systemd: Failed to start Run ansible-pull on boot.
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 # Feb 5 16:37:50 hostname systemd: Unit ansible-pull.service entered failed state.
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 # Feb 5 16:37:50 hostname systemd: ansible-pull.service failed.
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 while (defined(my $ThisLine = <STDIN>)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 chomp($ThisLine);
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
54 if ($ThisLine =~ /^(Activat|Deactivat|Mount|Unmount|Reload|Start|Stopp)ing / or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
55 $ThisLine =~ /^Finished / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 # These events will be caught with the Unit X entered failed state message
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 $ThisLine =~ /^Failed to start / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
58 $ThisLine =~ /: Failed with result / or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
59 $ThisLine =~ /Failed at step / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 $ThisLine =~ / failed\.$/ or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
61 $ThisLine =~ /([Cc]ontrol|[Mm]ain|[Mm]ount) process exited, code=(exited|killed|dumped),? status=/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 # Informational
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
63 $ThisLine =~ /^Closed .*[\. ][Ss]ockets?\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
64 $ThisLine =~ /^Closed .* [Ss]cheduler\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
65 $ThisLine =~ /^Closed .* [Ww]atch\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
66 $ThisLine =~ /^Closed (?:Multimedia|Sound) System\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 $ThisLine =~ /^Closed udev / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
68 $ThisLine =~ /: Consumed .* CPU time\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
69 # crond will never restart process when it is restarted
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
70 $ThisLine =~ /^crond\.service: Found left-over process \d+ \(.*\) in control group while starting unit\. Ignoring\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
71 $ThisLine =~ /^Received SIGINT\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
72 $ThisLine =~ /^Deactivated / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 $ThisLine =~ /^Detected (architecture|virtualization) / or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 $ThisLine =~ /^Found device / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
75 $ThisLine =~ /Got automount request for \/proc\// or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 $ThisLine =~ /^Inserted module / or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77 $ThisLine =~ /^Listening on / or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78 $ThisLine =~ /^Mounted / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
79 $ThisLine =~ /^Queued start job for default target / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 $ThisLine =~ /^Relabelled / or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81 $ThisLine =~ /^Reloading\.$/ or # Happens on each boot at switch root
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
82 $ThisLine =~ /^RTC configured in / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 $ThisLine =~ /^Running in initial RAM disk\.$/ or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
84 $ThisLine =~ /^selinux: avc: *received policyload notice/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
85 $ThisLine =~ /^Set hostname to / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
86 $ThisLine =~ /^(?:Set up|Unset) automount Arbitrary Executable File Formats File System Automount Point\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87 $ThisLine =~ /^Shutting down\.$/ or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88 $ThisLine =~ /^Startup finished in / or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89 $ThisLine =~ /^Stopped / or
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90 $ThisLine =~ /^Switching root\.$/ or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
91 $ThisLine =~ /: Succeeded\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 $ThisLine =~ /^Successfully loaded SELinux policy in / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
93 $ThisLine =~ /already active, refusing\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
94 $ThisLine =~ /^Failed to propagate agent release message:/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95 $ThisLine =~ /: Supervising process .* which is not our child\. We'll most likely not notice when it exits\.$/ or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
96 $ThisLine =~ /: Got notification message from PID \d+, but reception is disabled\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
97 $ThisLine =~ /: Got notification message from PID \d+, but reception only permitted for main PID \d+/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
98 $ThisLine =~ /Cannot find unit for notify message of PID \d+/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
99 $ThisLine =~ /^systemd .* running in system mode/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
100 # This is preceeded by a more descriptive message
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
101 $ThisLine =~ /^This usually indicates unclean termination of a previous run, or service implementation deficiencies\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
102 $ThisLine =~ /Transaction is destructive\./ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
103 $ThisLine =~ /^Unit .* is bound to inactive unit .*\. Stopping, too\./ or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
104 $ThisLine =~ /Unit (.* is )?not needed anymore\. Stopping\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
105 $ThisLine =~ /State '(stop-sigterm|stop-final-sigterm)' timed out\. Killing\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
106 $ThisLine =~ /: Start(-pre)? operation timed out\. Terminating\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
107 $ThisLine =~ /hold-?off time over, scheduling restart\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
108 $ThisLine =~ /Service has no hold-off time.*, scheduling restart\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
109 $ThisLine =~ /Service Restart.* expired, scheduling restart\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
110 $ThisLine =~ /Scheduled restart job, restart counter is at .*\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
111 $ThisLine =~ /Stopping timed out\. Killing\./ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
112 $ThisLine =~ /^Timed out waiting for/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
113 $ThisLine =~ /: Watchdog timeout/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
114 $ThisLine =~ /^Dependency failed for / or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
115 $ThisLine =~ /Processes still around after .*SIGKILL\./ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
116 $ThisLine =~ /^Unmounted / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
117 $ThisLine =~ /: Unit is bound to inactive unit / or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
118 $ThisLine =~ /[Hh]ardware watchdog / or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
119 # This is now trapped as a Slow Start error
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
120 #$ThisLine =~ /PID file .* not readable \(yet\?\) after start/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
121 $ThisLine =~ /Failed to read PID from file / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
122 # Units can depend on files that do not exist
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
123 $ThisLine =~ /Cannot add dependency job(:? for unit .*)?, ignoring: Unit (:?.* failed to load: No such file or directory|not found)\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124 # https://bugs.freedesktop.org/show_bug.cgi?id=90386
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
125 $ThisLine =~ /Dev(ice)? .* appeared twice with different sysfs paths .* and / or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126 # Inactive units are sometimes reloaded
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127 $ThisLine =~ /^Unit .* cannot be reloaded because it is inactive\.$/ or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
128 $ThisLine =~ /^.*: Unit cannot be reloaded because it is inactive\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
129 $ThisLine =~ / is not active\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 # https://bugzilla.redhat.com/show_bug.cgi?id=1306452
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
131 $ThisLine =~ /^[^ ]*\.mount: Directory \/[^ ]* to mount over is not empty, mounting anyway\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
132 # A known issue - reported by multiple distributions
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
133 $ThisLine =~ /^user\@\d+\.service: Failed at step CGROUP spawning \/usr\/lib\/systemd\/systemd: No such file or directory$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
134 $ThisLine =~ /^Received SIGRTMIN\+2[01] from PID \d+ \((?:plymouthd|n\/a)\)\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
135 # https://bugzilla.redhat.com/show_bug.cgi?id=1072368
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
136 $ThisLine =~ /^Received SIGRTMIN\+24 from PID \d+ \((?:kill|n\/a)\)\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
137 $ThisLine =~ /: Killing process \d+ \(.*\) with signal SIG.+\.$/ or
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
138 $ThisLine =~ /^Removed slice / or
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
139 $ThisLine =~ /^pam_unix\(systemd-user:session\): session (?:opened|closed) for user/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
140 $ThisLine =~ /Adding .* random time\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
141 # https://bugzilla.redhat.com/show_bug.cgi?id=1890632
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
142 $ThisLine =~ /Not generating service for XDG autostart .*,/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
143 $ThisLine =~ /gnome-systemd-autostart-condition not found/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
144 $ThisLine =~ /kde-systemd-start-condition not found/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
145 $ThisLine =~ /Unknown key name .* in section 'Desktop Entry'/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
146 # These happen on every shutdown - downgraded to debug message in systemd v235
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
147 # https://github.com/systemd/systemd/issues/6777
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
148 $ThisLine =~ /^Failed to propagate agent release message: (?:Connection reset by peer|Transport endpoint is not connected)/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
149 $ThisLine =~ /^cgroup compatibility translation between legacy and unified hierarchy settings activated\. See cgroup-compat debug messages for details\.$/ or
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
150 $ThisLine =~ /^.*\.socket: Socket service .* already active/
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
151 ) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
152 # Ignore these
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
153 } elsif (my ($service,$reason) = ($ThisLine =~ /^Configuration file ([^ ]*) is ([^.]*)\./)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
154 $ConfigError{$reason}{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
155 } elsif (my ($service,$reason) = ($ThisLine =~ /^\[(.*)\] (Support for option .* has been removed) and it is ignored/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
156 $ConfigError{$reason}{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
157 } elsif (my ($service,$reason) = ($ThisLine =~ /^\[?([^\]:]+(?::\d+)?)[\]:]? (Unknown .* in section '.*')/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
158 $ConfigError{$reason}{$service}++;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
159 } elsif (my ($service) = ($ThisLine =~ /^Unit (.*) entered failed state\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
160 $Failed{$service}++;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
161 } elsif (my ($service) = ($ThisLine =~ /^(.*): Failed to execute command/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
162 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
163 } elsif (my ($service) = ($ThisLine =~ /^(.*): Unit entered failed state\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
164 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
165 } elsif (my ($service) = ($ThisLine =~ /^(.*) failed with error code \d+\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
166 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
167 } elsif (my ($service) = ($ThisLine =~ /^(.*): Start request repeated too quickly\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
168 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
169 } elsif (my ($service) = ($ThisLine =~ /^(.*): Job .* timed out\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
170 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
171 } elsif (my ($service) = ($ThisLine =~ /^(.*): Job .* failed with result .*$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
172 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
173 } elsif (my ($service) = ($ThisLine =~ /^Failed (unmounting .*)\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
174 $Failed{$service}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
175 } elsif (my ($service) = ($ThisLine =~ /^Failed to (listen on .*)\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
176 $Failed{$service}++;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
177 } elsif (my ($target) = ($ThisLine =~ /^Reached target (.*)\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
178 $Target{$target}++;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
179 $LastTarget = $target;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
180 } elsif (my ($session, $user) = ($ThisLine =~ /^Started Session (\d+) of user (.*)\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
181 $UserSession{$user}->{$session}++;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
182 } elsif (my ($service) = ($ThisLine =~ /^Activated (.*)\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
183 $Activated{$service}++;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
184 } elsif (my ($service) = ($ThisLine =~ /^Started (.*)\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
185 $Started{$service}++;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
186 } elsif (my ($service) = ($ThisLine =~ /^Reloaded (.*)\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
187 $Reloaded{$service}++;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
188 } elsif (my ($service) = ($ThisLine =~ /^Deactivated (.*)\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
189 $Deactivated{$service}++;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190 } elsif ($ThisLine eq "Reexecuting.") {
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
191 $Reexecuted++ if $Detail;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
192 } elsif ($ThisLine =~ /^Time has been changed$/) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
193 $TimeChanged++;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
194 } elsif (my ($slice) = ($ThisLine =~ /^Created slice (.*)\.$/)) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
195 $Slice{$slice}++;
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
196 } elsif (my ($name) = ($ThisLine =~ /^Condition check resulted in (.*) being skipped\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
197 $Skipped{$name}++ if $Detail;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
198 } elsif (my ($pidfile) = ($ThisLine =~ /^PID file (.*) not readable \(yet\?\) after start\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
199 $Slow{$pidfile}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
200 } elsif (my ($pidfile) = ($ThisLine =~ /: Can't open PID file (.*) \(yet\?\) after start:/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
201 $Slow{$pidfile}++;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
202 } elsif (my ($Service, $Exe) = ($ThisLine =~ /^(.*): Found left-over process \d+ \((.*)\) in control group while starting unit\. Ignoring\.$/)) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
203 $LeftOver{"$Service:$Exe"}++ unless "$Service:$Exe" =~/^$Ignore_leftover$/i;
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
204 } else {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
205 $OtherList{$ThisLine}++;
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
209 if (keys %ConfigError) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
210 print "Configuration errors:\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
211 foreach my $reason (sort {$a cmp $b} keys %ConfigError) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
212 my $tot = 0;
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
213 print " $reason";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
214 foreach my $service (sort {$a cmp $b} keys %{$ConfigError{$reason}}) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
215 $tot += $ConfigError{$reason}{$service};
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
216 if ($Detail >= 10) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
217 print "\n $service: $ConfigError{$reason}{$service} Time(s)";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
218 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
219 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
220 if ($Detail < 10) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
221 print ": $tot Time(s)"
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
222 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
223 print "\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
224 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
225 print "\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
226 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
227
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
228 # Because we set Failed in multiple locations, cleanup once here
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
229 foreach my $item (keys %Failed) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
230 delete $Failed{$item} if ($item =~ /^$Ignore_failed$/i);
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
231 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
232
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
233 if (keys %Failed) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
234 print "ERROR: Failed state:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
235 foreach my $item (sort {$a cmp $b} keys %Failed) {
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
236 print " $item: $Failed{$item} Time(s)\n";
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
237 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
238 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
239 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
240
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
241 # Detail >= 1
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
242 if ($Reexecuted) {
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
243 print "Reexecuted systemd: $Reexecuted Time(s)\n\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
244 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
246 if (keys %Skipped) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
247 print "Condition check resulted in the following being skipped:\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
248 foreach my $item (sort {$a cmp $b} keys %Skipped) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
249 print " $item: $Skipped{$item} Time(s)\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
250 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
251 print "\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
252 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
253
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
254 if (keys %LeftOver) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
255 print "Warning: Found left-over process in control group while starting unit:\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
256 foreach my $item (sort {$a cmp $b} keys %LeftOver) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
257 my ($service, $exe) = split(":", $item);
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
258 print " $service($exe): $LeftOver{$item} Time(s)\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
259 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
260 print "\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
261 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
262
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
263 if (keys %Target && $Detail > 3) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
264 print "Reached target $LastTarget: $Target{$LastTarget} Time(s)";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
265 if ($Detail > 10) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
266 print ", and:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
267 foreach my $target (sort {$a cmp $b} keys %Target) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
268 print " $target: $Target{$target} Time(s)\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
269 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
270 } else {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
271 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
272 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
273 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
274 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
275
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
276 if (keys %Started && $Detail > 3) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
277 print "Started:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
278 foreach my $started (sort {$a cmp $b} keys %Started) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
279 print " $started: $Started{$started} Time(s)\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
280 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
281 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
282 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
283
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
284 if (keys %Activated && $Detail > 3) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
285 print "Activated:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
286 foreach my $item (sort {$a cmp $b} keys %Activated) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
287 print " $item: $Activated{$item} Time(s)\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
288 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
289 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
290 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
291
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
292 if (keys %Slow && $Detail > 3) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
293 print "Slow to start:\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
294 foreach my $pidfile (sort {$a cmp $b} keys %Slow) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
295 print " $pidfile: $Slow{$pidfile} Time(s)\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
296 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
297 print "\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
298 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
299
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
300 if (keys %Reloaded && $Detail > 5) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
301 print "Reloaded:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
302 foreach my $item (sort {$a cmp $b} keys %Reloaded) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
303 print " $item: $Reloaded{$item} Time(s)\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
304 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
305 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
306 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
307
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
308 if (keys %Deactivated && $Detail > 5) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
309 print "Deactivated:\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
310 foreach my $item (sort {$a cmp $b} keys %Deactivated) {
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
311 print " $item: $Deactivated{$item} Time(s)\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
312 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
313 print "\n";
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
314 }
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
315
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
316 if ($TimeChanged && $Detail > 5) {
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
317 print "Time Changed: $TimeChanged Time(s)\n\n";
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
318 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
319
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
320 if (keys %UserSession && $Detail > 3) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
321 print "User Sessions:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
322 foreach my $user (sort {$a cmp $b} keys %UserSession) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
323 print " $user: ";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
324 if ($Detail >= 10) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
325 foreach my $session (sort {$a cmp $b} keys %{$UserSession{$user}}) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
326 print " $session";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
327 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
328 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
329 } else {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
330 print scalar(keys %{$UserSession{$user}}) . ": Time(s)\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
331 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
332 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
333 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
334 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
335
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
336 if (keys %Slice && $Detail > 5) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
337 print "Slices created:\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
338 foreach my $slice (sort {$a cmp $b} keys %Slice) {
369
85a5a231b0b5 Update Logwatch Systemd to handle lots of unmatched entries
IBBoard <dev@ibboard.co.uk>
parents: 347
diff changeset
339 print " $slice: $Slice{$slice} Time(s)\n";
347
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
340 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
341 print "\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
342 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
343
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
344 if (keys %OtherList) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
345 print "\n\n**Unmatched Entries**\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
346 foreach my $line (sort {$a cmp $b} keys %OtherList) {
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
347 print " $line: $OtherList{$line} Time(s)\n";
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
348 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
349 }
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
350
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
351 exit(0);
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
352
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
353 # vi: shiftwidth=3 tabstop=3 syntax=perl et
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
354 # Local Variables:
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
355 # mode: perl
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
356 # perl-indent-level: 3
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
357 # indent-tabs-mode: nil
73d7b3ec6263 Ignore log entries from Cron tasks running in user mode
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
358 # End: