NAME
checkLogExist.pl - checks Log-entries at given times
SYNOPSIS
checkLogExist.pl
DESCRIPTION
checkLogExist should be called frequently in a separate job and checks if defined log entries exist in the defined log files, (hinting that the task was run/started), resp. whether the Logfile exists at all.
Configuration is done in sub-hash $config{checkLookup}
, being the same place for the errmailaddress/errmailsubject of error mails being sent in the tasks themselves:
$config{checkLookup} = {
<nameOfJobscript.pl> => {
errmailaddress => "test\@test.com",
errmailsubject => "testjob failed",
timeToCheck => "0800",
freqToCheck => "B",
logFileToCheck => "test.log",
logcheck => "started.*"
},
<...> => {
},
}
The key consists of the scriptname + any additional defined interactive options, which are being passed to the script in an alphabetically sorted manner. For checkLogExist.pl the key is irrelevant as all entries of $config{checkLookup}
are worked through.
- errmailaddress
-
where should the mail sent to in case of non-existence or an error.
- errmailsubject
-
subject-line for error mail, only used for error mail sending in the tasks itself.
- timeToCheck
-
all checks earlier than this are ignored
- freqToCheck
-
ignore log check except on: ML..Monthend, D..every day, B..Business days, M1..Month-beginning, W{n}..Weekday (n:1=Sunday-7=Saturday)
- logFileToCheck
-
Where (which logfile) should the job have written into ?
- logcheck
-
"regex keyword/expression" to compare the rows, if this is missing in the logfile after the current date/timeToCheck then an alarm is sent to the configured errmailaddress
COPYRIGHT
Copyright (c) 2023 Roland Kapl
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.