[Pacemaker] Re: How can stonith-plugins send messages to ha-log?

Takenaka Kazuhiro takenaka.kazuhiro at oss.ntt.co.jp
Thu Sep 25 08:03:39 UTC 2008


Hi, Dejan

Thanks for your reply.

 >> > If there is a similar function to 'ocf_log' for stonith-plugins,
 >> > I think it must be handy. Or I should simply have my stonith-plugins
 >> > use 'ocf_log'?
 >
 > Yes.

I suspected a bit that 'stonithd' might not pass some of enviroment
valiables to plugins, So I tried to check it out and found that
'HA_LOGD' wasn't given to plugins.

I wrote the following statements into my plugin.

. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
ha_logger -t INFO -D ha-log "Sending a message by ha_logger"
ocf_log INFO "Sending a message by ocf_log"

Then I ran my cluster and watched /var/log/ha-log. The messages of
'ha_logger' appeared in 'ha-log', but those of 'ocf_log' did not.
Because 'ha_log' (called by ocf_log) doesn't use 'ha_logger' when
'HA_LOGD' isn't defined.

One way is to change 'stonithd' to pass 'HA_LOGD' to plugins.
Or plugins should use 'ha_logger' directly?

 > Though the preferable way would be to have the parent plugin
 > (external.c) collect the output and send it to the logger, in the
 > same way the lrmd does with resource agents.

I think the way you suggested is also a possible choice.

Actually, some existing plugins expect this function. They use 'echo'
to put their messages. But currently, those messages are sent to
'ha-debug', not 'ha-log'.

> Hi,
> 
> On Wed, Sep 24, 2008 at 04:14:03PM +0900, Takenaka Kazuhiro wrote:
>> > Hi all.
>> > 
>> > I looked through stonith-plugins in /usr/lib/stonith/plugins/external
>> > to find out stonith-plugins' official way to send their messages to
>> > ha-log, but I couldn't find it.
>> > 
>> > If there is a similar function to 'ocf_log' for stonith-plugins,
>> > I think it must be handy. Or I should simply have my stonith-plugins
>> > use 'ocf_log'?
> 
> Yes.
> 
> Though the preferable way would be to have the parent plugin
> (external.c) collect the output and send it to the logger, in the
> same way the lrmd does with resource agents.
> 
> Thanks,
> 
> Dejan
> 
>> > Best regards.
>> > -- 
>> > Takenaka Kazuhiro <takenaka.kazuhiro at oss.ntt.co.jp>
>> > 
>> > _______________________________________________
>> > Pacemaker mailing list
>> > Pacemaker at clusterlabs.org
>> > http://list.clusterlabs.org/mailman/listinfo/pacemaker
> 
> _______________________________________________
> Pacemaker mailing list
> Pacemaker at clusterlabs.org
> http://list.clusterlabs.org/mailman/listinfo/pacemaker

-- 
Takenaka Kazuhiro <takenaka.kazuhiro at oss.ntt.co.jp>




More information about the Pacemaker mailing list