[ClusterLabs] Antw: Re: Antw: Struggling to get "crm_mon -E ... " to do anything

Brett Moser brett.moser at gmail.com
Mon May 11 13:29:54 EDT 2015


Hi Ulrich,

The ClusterMon OCF must be configured with the extra_options parameter:

# Sample configuration
# ================================
# primitive ClusterMon ocf:pacemaker:ClusterMon \
#        params user="root" update="30" extra_options="-E
/path/to/pcmk_snmp_helper.sh -e 192.168.1.2" \
#        op monitor on-fail="restart" interval="10"


Have you looked at the pcmk_snmp_helper.sh
<https://github.com/ClusterLabs/pacemaker/blob/master/extra/pcmk_snmp_helper.sh>
 script that Florian CROUZAT created?   It provides a good example of how
to get the information provided when an external program is executed by
crm_mon.  The parameters are passed as Environment variables, similar to
how Resource Agents work in Pacemaker:

CRM_notify_recipient
CRM_notify_node
CRM_notify_rsc
CRM_notify_task
CRM_notify_desc
CRM_notify_status
CRM_notify_rc
CRM_notify_target_rc

regards,
-Brett Moser


On Mon, May 11, 2015 at 6:46 AM, Ulrich Windl <
Ulrich.Windl at rz.uni-regensburg.de> wrote:

> >>> Riley <riley at on.net.nz> schrieb am 11.05.2015 um 12:05 in Nachricht
> <55507ECD.7050706 at on.net.nz>:
> > Ulrich,
> >            well I guess 'man crm_mon' does not tell you very much, but
> > the ClusterMon resource uses crm_mon, and chapter 7 of the Pacemaker
> > documentation,
> >
> http://clusterlabs.org/doc/en-US/Pacemaker/1.1-crmsh/html/Pacemaker_Explained/
> > s-notification-external.html,
> > documents the CRM_notify_* environment variables.
>
> Actually I'm more confused than before now ;-)
>
> So there is a ClusterMon OCF RA that is started by the cluster, and that
> monitor starts "crm_mon" to periodically dump the configuration to a HTML
> file. If all I can get is a text dump of the configuration, it's rather
> ridiculous.
>
> I fail to see the connection to the argument to option "-E" in the
> documentation you are referring to, and section 7.3 (The example) really
> lacks an example how such variables look like (and what to do with them).
>
> Regards,
> Ulrich
>
> >
> > (No arguments/parameters are passed to the program that is called via
> > it's command line, everything is through the environment variables)
> >> ...
> >>> I have set up a virtual test environment of three nodes running CentOS
> >>> 6.6 and am having trouble getting a "crm_mon -E " script called *at
> all*
> >>> when anything changes in the cluster (resource killed, node killed,
> >>> resource moved, etc.).
> >> Never heard of that option, but when considering the documentation, I'm
> not
> > much surprised if it doesn't work as one might expect:
> >>        -E, --external-agent=value
> >>               A program to run when resource operations take place.
> >>
> >> This leaves a LOT of room for expectations. ;-)
> >>
> >> What should be a typical use case? Will the program have any parameters?
> >>
> >
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20150511/1d5bd855/attachment-0003.html>


More information about the Users mailing list