Re: Art's eventalarm questions
Posted in 2006
Gary Quiring wrote:
> I am confused about the eventalarm backing up transaction logs. If I
> am running ontape -s -L 0 eventalarm is telling me an ontape is already
That should not happen. More likely another logical log completed
immediately prior to log 631 and was still being archived. Eventalarm
detected that and exited. Either log 631 would get picked up by the ontape
-a archiving logical log 630 or the one started for logical log 632 when it
completes. There is a possibility, eventalarm detects a previous iteration
still running by looking in a log file, event.S2.C23 which will have been
created by any running copy of eventalarm in the startup directory of oninit
(usually but not always that's $INFORMIXDIR). When it starts up for a
logical log archive, eventalarm checks for the existence of that file and if
it exists tries to read the pid its sibling would have written there. If it
reads a pid it tries to ping the task with kill(pid,0). If the task exists
or if the file existed and was empty (which might indicate a race condition
with an eventalarm copy that's in the process of writting to the file) it
prints that message and exits. If there was no file it creates a new one.
If the file existed but the pid no longer exists it rewinds the file. Then
it writes its own pid into that file to prevent double runs. When it is
finished, eventalarm leaves the file there. It IS possible that a random
task, perhaps event the ontape -s run, could have the same pid as the
previous run of eventalarm, but unlikely. When this happens, you can just
delete the file to fix the problem. The file is binary, but it is possible
to type the contents in hex with od -x and translate them into a decimal pid
using bc or some other tool to see if this is the problem.
> running. Is that normal? I thought it just checked for ontape -a jobs?
> My full backup takes several hours. Is there anyway to make it backup
> the logs with a full backup running?
Bottom line, normally it should do that barring the pid confusion mentioned
above.
> Jun 09 11:12:04 :NonFatal Event: Severity=2, Class=23.
> Jun 09 11:12:04 :5 args passed
> Jun 09 11:12:04 :Arg 0: "/usr/local/bin/eventalarm".
> Jun 09 11:12:04 :Arg 1: "2".
> Jun 09 11:12:04 :Arg 2: "23".
> Jun 09 11:12:04 :Arg 3: "Logical Log 631 Complete, timestamp:
> 0xab3e3741.".
> Jun 09 11:12:04 :Arg 4: "Logical Log 631 Complete, timestamp:
> 0xab3e3741.".
> Jun 09 11:12:04 :ontape is already running.
>
> Also I just want to make sure I am understanding this whole setup. Do
> I need to use the log_full.sh script that Art provided or does
> eventalarm use it's own?
The log_full.sh is just an example of writing your own script to archive the
logs using ontape, just as the delivered log_full.sh does using onbar, if
you do not want the full eventalarm feature set. Installing eventalarm in
the ALARMPROGRAM onconfig entry and creating the eventalarm.cfg in
$INFORMIXDIR with the settings you want is all you need to do to get
eventalarm working.
> ALARMPROGRAM /usr/local/bin/eventalarm
> LTAPEDEV /u/ifmxlogs>
Art S. Kagel