[ClusterLabs] logging in fence agents

Dejan Muhamedagic dejanmm at fastmail.fm
Wed Mar 11 10:24:12 UTC 2015


Hi,

On Wed, Mar 11, 2015 at 11:39:59AM +0200, Kostiantyn Ponomarenko wrote:
> Hi,
> 
> Thank you for your reply.
> I realized that I wasn't clear in my question.
> I wrote a fence agent by myself.
> And I am in doubts what is the best way to make logging in that agent.
> I like the way OCF resource agents do they logging, but it doesn't work for
> fence agents - environment variables are different.

We faced the same issue with stonith agents (glue) and it got
resolved by implementing a simple shell script which mimics
ocf_log from resource agents. More information here:

https://developerbugs.linuxfoundation.org/show_bug.cgi?id=1971
http://hg.linux-ha.org/glue/file/tip/lib/stonith/ha_log.sh

Perhaps you can do something similar for fence agents.

Thanks,

Dejan

> I am about to just write/append ( >> ) to Corosync's log file, because I
> don't have any other ideas ... .
> Would be appreciated for any ideas.
> 
> 
> Thank you,
> Kostya
> 
> On Wed, Mar 11, 2015 at 11:18 AM, Marek "marx" Grac <mgrac at redhat.com>
> wrote:
> 
> >
> > On 03/06/2015 03:12 PM, Kostiantyn Ponomarenko wrote:
> >
> >> Hi guys,
> >>
> >> Is there a way to use Corosync's log file for fence agent?
> >> I was going to use the same logging system as in resource agents, but I
> >> found that fence agents have a different set of environment variables.
> >> So this string doesn't work:
> >> : ${OCF_FUNCTIONS=${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs}
> >>
> >> Another question - is it possible to use OSF standart for fence agents (I
> >> suppose it is not, but want to ensure).
> >>
> >> What is the common practice for logging in fence agents (where to write
> >> logs)?
> >>
> >>  Hi,
> >
> > for fence agents, there is possibility to set logging directly. Add
> > "debug=file" and "verbose=1" (or on command line --debug-file=FILE
> > --verbose)
> >
> > m,
> >
> > _______________________________________________
> > Users mailing list: Users at clusterlabs.org
> > http://clusterlabs.org/mailman/listinfo/users
> >
> > Project Home: http://www.clusterlabs.org
> > Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> > Bugs: http://bugs.clusterlabs.org
> >

> _______________________________________________
> Users mailing list: Users at clusterlabs.org
> http://clusterlabs.org/mailman/listinfo/users
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org





More information about the Users mailing list