/usr/share/logwatch/scripts/services/evtsystem is in logwatch 7.4.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | #!/usr/bin/perl
##########################################################################
# $Id: evtsystem 203 2014-07-18 18:04:48Z opoplawski $
##########################################################################
# $Log: evtsystem,v $
# Revision 1.3 2008/06/30 23:07:51 kirk
# fixed copyright holders for files where I know who they should be
#
# Revision 1.2 2008/03/24 23:31:26 kirk
# added copyright/license notice to each script
#
# Revision 1.1 2007/04/28 22:50:24 bjorn
# Added files for Windows Event Log, by Orion Poplawski. These are for
# Windows events logged to a server, using Snare Agent or similar.
#
##########################################################################
########################################################
## Copyright (c) 2008 Orion Poplawski
## Covered under the included MIT/X-Consortium License:
## http://www.opensource.org/licenses/mit-license.php
## All modifications and contributions by other persons to
## this script are assumed to have been donated to the
## Logwatch project and thus assume the above copyright
## and licensing terms. If you want to make contributions
## under your own copyright or a different license this
## must be explicitly stated in the contribution an the
## Logwatch project reserves the right to not accept such
## contributions. If you have made significant
## contributions to this script and want to claim
## copyright please contact logwatch-devel@lists.sourceforge.net.
#########################################################
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
while (defined($ThisLine = <STDIN>)) {
my ($Hostname,$Criticality,$SourceName,$DateTime,$EventID,$System,$UserName,$SIDType,$EventLogType,$CategoryString,$DataString,$ExpandedString,$Extra);
#Determine format
if ($ThisLine =~ /MSWinEventLog\[/) { # Snare 4
#Parse
($Criticality,$SourceName,$DateTime,$EventID,$System,$UserName,$SIDType,$EventLogType,$Hostname,$CategoryString,$DataString,$ExpandedString,$Extra) =
($ThisLine =~ /MSWinEventLog\[(\d+)\]:(\w+)\t\d+\t([^\t]+)\t(\d+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t?([^\t]*)\t?([^\t]*)\t?([^\t]*)\t?([^\t]*)/);
} elsif ($ThisLine =~ /MSWinEventLog\t/) { # Snare 3
#Parse
($Criticality,$SourceName,$DateTime,$EventID,$System,$UserName,$SIDType,$EventLogType,$Hostname,$CategoryString,$DataString,$ExpandedString,$Extra) =
($ThisLine =~ /MSWinEventLog\t(\d+)\t(\w+)\t\d+\t([^\t]+)\t(\d+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t?([^\t]*)\t?([^\t]*)\t?([^\t]*)\t?([^\t]*)/);
}
if (!defined($Hostname)) {
print STDERR "Cannot parse $ThisLine";
next;
}
#print STDERR "ExpandedString = $ExpandedString\n";
if ($System eq "Application Popup") {
#Ignore these
next if $ExpandedString =~ /Initialization Failed : The application failed to initialize because the window station is shutting down/;
next if $ExpandedString =~ /^Application popup: Windows : Other people are logged on to this computer. Shutting down Windows might cause them to lose data\. Do you want to continue shutting down\?$/;
next if $ExpandedString =~ /^Application popup: Message from .*: Automatic software deployment is currently updating your system\. Please save all your documents as the the system might reboot without further notice\. Thank you\./;
next if $ExpandedString =~ /^Application popup: Message from .*: The automated software installation utility has completed installing or updating software on your system\. No reboot was necessary\. All updates are complete\./;
}
if ($System eq "BTHUSB") {
next if $ExpandedString =~ /^Windows cannot store Bluetooth authentication codes \(link keys\) on the local adapter\. Bluetooth keyboards might not work in the system BIOS during startup\.$/ and $Detail < 5;
}
if ($System =~ "EventLog") {
#Ignore these
next if $ExpandedString =~ /Microsoft \(R\) Windows \(R\) \d+\.\d+\. \d+ Service Pack \d/;
next if $ExpandedString =~ /^The Event log service was started./;
next if $ExpandedString =~ /^The Event log service was stopped./;
next if $ExpandedString =~ /^The system uptime is \d+ seconds/;
}
if ($System =~ "LsaSrv") {
#Ignore these
next if $ExpandedString =~ /^A logon cache entry for user .* was the oldest entry and was removed\. The timestamp of this entry was/;
}
if ($System eq "Microsoft-Windows-Application-Experience") {
#Ignore these
next if $ExpandedString eq "The Program Compatibility Assistant service successfully performed phase two initialization.";
}
if ($System eq "Microsoft-Windows-FilterManager") {
#Ignore these
next if $ExpandedString =~ /^File System Filter .* has successfully loaded and registered with Filter Manager\.$/;
}
if ($System eq "Microsoft-Windows-Kernel-General") {
#High Detail
next if $ExpandedString =~ /^The operating system started at system time/ and $Detail < 10;
next if $ExpandedString =~ /^The operating system is shutting down at system time/ and $Detail < 10;
#TODO - We should warn is this is big
next if $ExpandedString =~ /^The system time has changed to .* from/;
}
if ($System eq "Microsoft-Windows-Kernel-Power") {
#High Detail
next if $ExpandedString =~ /^The system is entering sleep/ and $Detail < 10;
next if $ExpandedString =~ /^The kernel power manager has initiated a shutdown transition\.$/ and $Detail < 10;
#Ignore these
next if $ExpandedString =~ /^ACPI thermal zone .* has been enumerated/;
}
if ($System eq "Microsoft-Windows-Kernel-Processor-Power") {
#Ignore these
next if $ExpandedString =~ /^Processor \d+ in group \d+ exposes the following:/;
}
if ($System eq "Microsoft-Windows-GroupPolicy") {
#Ignore these
next if $ExpandedString =~ /^The Group Policy settings for the (computer|user) were processed successfully\. There were no changes detected since the last successful processing of Group Policy\.$/;
next if $ExpandedString =~ /^The Group Policy settings for the (computer|user) were processed successfully\. New settings from \d+ Group Policy objects were detected and applied\.$/ and $Detail == 0;
}
if ($System eq "Microsoft-Windows-Power-Troubleshooter") {
#High Detail
next if $ExpandedString =~ /^The system has resumed from sleep/ and $Detail < 10;
}
if ($System eq "Microsoft-Windows-Time-Service") {
#High Detail
next if $ExpandedString =~ /^The time provider NtpClient is currently receiving valid time data from/ and $Detail < 10;
next if $ExpandedString =~ /^The time service is now synchronizing the system time with the time source/ and $Detail < 10;
}
if ($System eq "Microsoft-Windows-WindowsUpdateClient" or
$System eq "Windows Update Agent") {
#High Detail
next if $ExpandedString =~ /^Automatic Updates is now paused\.$/ and $Detail < 10;
#Updates
if (($InstallDateTime, $Updates) = $ExpandedString =~ /^Installation Ready: The following updates are downloaded and ready for installation. This computer is currently scheduled to install these updates on (.*): - (.*)$/) {
$UpdatesReadyForInstall{$Hostname}->{$InstallDateTime} = $Updates;
next;
}
if (($Update) = $ExpandedString =~ /^Installation Successful: Windows successfully installed the following update: (.*)$/) {
push(@{$UpdatesInstalled{$Hostname}},$Update);
next;
}
if ($ExpandedString =~ /^Restart Required:/) {
$RestartRequired{$Hostname} = 1;
next;
}
}
if ($System eq "Microsoft-Windows-Winlogon") {
#High Detail
next if $ExpandedString =~ /User \w+ Notification for Customer Experience Improvement Program/ and $Detail < 10;
}
if ($System eq "Service Control Manager") {
#Ignore these
next if $ExpandedString =~ /^The (.*) service entered the running state\./;
next if $ExpandedString =~ /^The (.*) service entered the stopped state\./;
next if $ExpandedString =~ /^The (.*) service was successfully sent a start control\./;
next if $ExpandedString =~ /^The (.*) service was successfully sent a stop control\./;
}
if ($System eq "USER32") {
#High Detail
next if $ExpandedString =~ /^The process .* has initiated the power off of computer \w+ on behalf of user .* for the following reason: .*$/ and $Detail < 10;
}
if ($System eq "Virtual Disk Service") {
#High Detail
next if $ExpandedString =~ /Service (started|stopped)/ and $Detail < 10;
}
if ($System eq "atikmdag") {
#Ignore these
next if $ExpandedString =~ /^UVD Information$/;
#High Detail
next if $ExpandedString =~ /^Display is not active$/ and $Detail < 10;
}
if ($System eq "volsnap") {
#Med Detail
next if $ExpandedString =~ /^The oldest shadow copy of volume .* was deleted to keep disk space usage for shadow copies of volume .* below the user defined limit\.$/ and $Detail < 5;
}
next if $ExpandedString =~ /client service is started$/ and $Detail < 10;
next if $ExpandedString =~ /started successfully\.$/ and $Detail < 10;
next if $ExpandedString =~ /has successfully (started|stopped)\./ and $Detail < 10;
next if $ExpandedString =~ /^Service .* (started|stopped)\.$/ and $Detail < 10;
next if $ExpandedString =~ /Driver initialized successfully\.$/ and $Detail < 10;
next if $ExpandedString =~ /Network controller configured for .* link\.$/ and $Detail < 10;
next if $ExpandedString =~ /^The driver package installation has succeeded\.$/ and $Detail < 10;
next if $ExpandedString =~ /^UVD Information$/;
next if $ExpandedString =~ /Link has been established:/;
# Add to the list
$Systems{$System}->{"$Hostname $ExpandedString"}++;
}
# Handle high priority errors first
$System = "Microsoft-Windows-WER-SystemErrorReporting";
if (defined($Systems{$System})) {
print "\nSYSTEM ERRORS!:\n";
foreach $Error (sort(keys %{$Systems{$System}})) {
print " $Error : $Systems{$System}->{$Error} Times\n";
}
delete($Systems{$System});
}
print "\n";
if (keys %Systems) {
foreach $System (sort(keys %Systems)) {
print "\n$System\n";
foreach $Error (sort(keys %{$Systems{$System}})) {
print " $Error : $Systems{$System}->{$Error} Times\n";
}
}
}
if (keys %UpdatesReadyForInstall or keys %UpdatesInstalled) {
print "\nWindows Update Summary:\n";
foreach $Hostname (sort(keys %UpdatesReadyForInstall)) {
foreach $InstallDateTime (sort(keys %{$UpdatesReadyForInstall{$Hostname}})) {
print " Updates ready for install on $Hostname on $InstallDateTime:\n";
print " $UpdatesReadyForInstall{$Hostname}->{$InstallDateTime}\n";
}
}
foreach $Hostname (sort(keys %UpdatesInstalled)) {
print " Updates successfully installed on $Hostname:\n";
foreach $Update (@{$UpdatesInstalled{$Hostname}}) {
print " $Update\n";
}
}
print " Restart required on hosts: " if keys %RestartRequired;
foreach $Hostname (sort(keys %RestartRequired)) {
print "$Hostname ";
}
print "\n";
}
exit(0);
# vi: shiftwidth=3 tabstop=3 syntax=perl et
# Local Variables:
# mode: perl
# perl-indent-level: 3
# indent-tabs-mode: nil
# End:
|