feat(logwatch): Update logwatch files for v3
Add new timestamp template and delete the old one. Update report script file to use new 'status' tags to generate logwatch reports.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# $Id$
|
||||
#############################################################################
|
||||
# Log: CloudFlare updater script (cfddns)
|
||||
# Revision 2.1 2021/05/08
|
||||
# Revision 3.0 2026/07/25
|
||||
# Written by Asif Bacchus
|
||||
#############################################################################
|
||||
|
||||
@@ -31,22 +31,22 @@ my $key;
|
||||
if ($detailLevel == 0) {
|
||||
### process logfile and summarize message types
|
||||
while (defined(my $ThisLine = <STDIN>)) {
|
||||
if ($ThisLine =~ /ERR: Unable to update IP address/) {
|
||||
if ($ThisLine =~ /[FAIL] Unable to update the IP address for/) {
|
||||
$summaryFailedUpdate++;
|
||||
}
|
||||
elsif ($ThisLine =~ /ERROR: /) {
|
||||
elsif ($ThisLine =~ /[FAIL] /) {
|
||||
$summaryErr++;
|
||||
}
|
||||
elsif ($ThisLine =~ /WARN: Cannot find existing record/) {
|
||||
elsif ($ThisLine =~ /[WARN] Cannot find an existing record matching/) {
|
||||
$summaryInvalidHost++;
|
||||
}
|
||||
elsif ($ThisLine =~ /WARNING: /){
|
||||
elsif ($ThisLine =~ /[WARN] /){
|
||||
$summaryWarning++;
|
||||
}
|
||||
elsif ($ThisLine =~ /SUCCESS: /) {
|
||||
elsif ($ThisLine =~ /[SUCCESS] /) {
|
||||
$summaryUpdated++;
|
||||
}
|
||||
elsif ($ThisLine =~ /already up-to-date/) {
|
||||
elsif ($ThisLine =~ /already up to date/) {
|
||||
$summaryUpToDate++;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ if ($detailLevel == 0) {
|
||||
$reportHash{"Entries successfully updated"} = $summaryUpdated;
|
||||
}
|
||||
if ($summaryUpToDate > 0) {
|
||||
$reportHash{"Entries already up-to-date"} = $summaryUpToDate;
|
||||
$reportHash{"Entries already up to date"} = $summaryUpToDate;
|
||||
}
|
||||
if ($summaryFailedUpdate > 0) {
|
||||
$reportHash{"Hosts failed to update"} = $summaryFailedUpdate;
|
||||
@@ -80,16 +80,16 @@ if ($detailLevel == 0) {
|
||||
### a summary count
|
||||
elsif ($detailLevel >= 1 && $detailLevel <= 4) {
|
||||
while (defined(my $ThisLine = <STDIN>)) {
|
||||
if ($ThisLine =~ /ERR: /) {
|
||||
if ($ThisLine =~ /[ERR] /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /WARN: /) {
|
||||
elsif ($ThisLine =~ /[WARN] /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /SUCCESS: /) {
|
||||
elsif ($ThisLine =~ /[SUCCESS] /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /already up-to-date/) {
|
||||
elsif ($ThisLine =~ /already up to date/) {
|
||||
print $ThisLine;
|
||||
}
|
||||
}
|
||||
@@ -98,25 +98,19 @@ elsif ($detailLevel >= 1 && $detailLevel <= 4) {
|
||||
### debugging messages
|
||||
elsif ($detailLevel == 5) {
|
||||
while (defined(my $ThisLine = <STDIN>)) {
|
||||
if ($ThisLine =~ /ERR: /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /ERROR: /) {
|
||||
if ($ThisLine =~ /[ERR] /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /CF-ERR: /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /WARN: /) {
|
||||
elsif ($ThisLine =~ /[WARN] /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /WARNING: /) {
|
||||
elsif ($ThisLine =~ /[SUCCESS] /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /SUCCESS: /) {
|
||||
print $ThisLine;
|
||||
}
|
||||
elsif ($ThisLine =~ /already up-to-date/) {
|
||||
elsif ($ThisLine =~ /already up to date/) {
|
||||
print $ThisLine;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user