help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

copy failover?


From: Wheeler, John
Subject: copy failover?
Date: Thu, 4 Mar 2004 11:08:34 -0600

I've looked through the archives to see if anyone else has had problems
with copy using the failover statement as well as the elesdefine and
define statements. Here's what I'm attempting to do. I use cfengine to
copy web server logs from several machines to a central repository (not
cfengine repository). I use cronolog (http://www.cronolog.org/) to
rotate my web server logs at midnight. I then have a job via cfengine
gzip the logs on the web servers. Then, I have a machine "collect" all
the web server logs at some time after the logs are zipped. I want to
set classes if the copy fails for some reason (like the cfagent job to
zip the logs failed). I currently have something like this:


copy:

        siterotate.desthost::
                $(sourcepath1).gz
                        dest=$(destdir)/web101prod/${destsuff1}
                        mode=744
                        type=checksum
                        inform=true
                        define=web101prod_britannica_80_defined
                        failover=web101prod_britannica_80_fail
                        elsedefine=web101prod_britannica_80_else
                        server=web101prod

with an control section similar to:

control:
        domain = ( eb.com )

        actionsequence  = (
                copy.siterotate
                shellcommands.siterotate
        )

and finally shellcommands as follows:

        siterotate.desthost.web101prod_britannica_80_fail::
                '/bin/echo "${alarmdate} First_Crit CRITICAL test
montype sitecopy_${_month}${_day}${_year} failed to copy a critical log
file from a web host" >> /monitoring/logs/tecad_logfile.log '

        siterotate.desthost.web101prod_britannica_80_define::
                '/bin/echo "${alarmdate} First_Crit HARMLESS ${fqhost}
montype sitecopy_${_month}${_day}${_year} copied all critical log file
from web hosts" >> /monitoring/logs/tecad_logfile.log '

        siterotate.desthost.web101prod_britannica_80_else::
                '/bin/echo "${alarmdate} First_Crit HARMLESS ${fqhost}
montype sitecopy_${_month}${_day}${_year} copied all critical log file
from web hosts" >> /monitoring/logs/tecad_logfile.log '

try not to get bogged down in the echo. I've copied it here verbatim
because I'm lazy. It works if I remove the class dependencies.

Ok if you've got this far, here's my question. If the source file does
not exist, cfservd reports the file is not statable, but NONE of the
classes are set. Not the elsedefine or the failover. Now I would expect
the failover to be set. I've run through debug, but the class "stack" is
not reported between action (unless there is another debug on cfagent,
I've been using --debug)

Also, for those still reading, I thought maybe the 2nd pass would
"engage" because of an unresolved dependency in the 1st pass. This is
not the case either, so that leads me to believe that the classes are
not being set at all.

Any idea's, comments, suggestions.

Oh most important  2.1.3 (just upgraded incase that was the problem) and
solaris 2.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]