[Pacemaker] crm_mon SNMP support

Florian Crouzat gentoo at floriancrouzat.net
Thu Feb 7 08:41:54 UTC 2013


Le 05/02/2013 02:36, Andrew Beekhof a écrit :
> On Fri, Feb 1, 2013 at 8:21 PM, Florian Crouzat
> <gentoo at floriancrouzat.net> wrote:
>> Le 01/02/2013 03:48, Andrew Beekhof a écrit :
>>
>>> On Tue, Jan 22, 2013 at 3:18 AM, Florian Crouzat
>>> <gentoo at floriancrouzat.net> wrote:
>>>>
>>>> Le 29/11/2012 22:10, Andrew Beekhof a écrit :
>>>>
>>>>> Not so fast :-)
>>>>>
>>>>> crm_mon supports
>>>>>
>>>>>           -E, --external-agent=value
>>>>>                  A program to run when resource operations take place.
>>>>>
>>>>>           -e, --external-recipient=value A recipient for your program
>>>>> (assuming you want the program to send something to someone).
>>>>>
>>>>> so without recompiling, you can call a script - possibly it could call
>>>>> something that sends out snmp alerts ;-)
>>>>
>>>>
>>>>
>>>>
>>>> So, I took a first shot at writing an external-agent script that would
>>>> somehow reproduce the behavior of crm_mon when SNMP support is built-in.
>>>>
>>>> Basically, to refocus the discussion, I've written this script because I
>>>> want to be alerted via SNMP on most of the cluster events but sadly my
>>>> version of crm_mon doesn't have SNMP support (RHEL6), so I cannot use
>>>> this
>>>> feature combined with ocf:pacemaker:ClusterMon but I can use crm_mon
>>>> ability
>>>> to trigger an external-agent (script, binary...)
>>>>
>>>> Script: http://files.floriancrouzat.net/clusterMon.sh
>>>> It respects PCMK-MIB.txt.
>>>
>>>
>>> Is that something you'd like to include with pacemaker?
>>
>>
>> Well, I'm really not sure it would be useful for anyone as it not generic at
>> all, and highly oriented for my needs.
>
> Looks pretty configurable to me.
>
>> Maybe it would fit better in an "example" section of Pacemaker_Explained
>
> That also works :)
>

Well, do as you please. I'm by no means able to choose :)

Not sure what you meant by "Is that something you'd like to include with 
pacemaker?" but feel free to commit the script to any "extra" or 
"script" folder in pacemaker sources, maybe remove my name and add the 
required license(s) to it or just paste the few bash lines I produced to 
the correct section of the correct documentation.

I did some polishing on the comments in the scripts since Chapter 7 of 
Pacemaker Explained has been published 
(http://clusterlabs.org/doc/en-US/Pacemaker/1.1-crmsh/html/Pacemaker_Explained/s-notification-external.html)


-- 
Cheers,
Florian Crouzat




More information about the Pacemaker mailing list