Nicolai Langfeldt | 15 Aug 2012 14:53
Picon

new RA: http_ping

Hi,

I've written a new RA based on what I learnt from the ping and nginx RAs
for monitoring frontend-proxy-stacks.

It is attached here for your consideration - and indeed - critique.  I
am hopeful that it makes it into the pacemaker distribution some time.

Regards,
  Nicolai
#!/bin/sh
#
#	High-Availability httpd daemon monitoring OCF agent
# 
# nginx
#
# Description:	monitors http servers (no start, no stop).
#
# Author:       Nicolai Langfeldt, Broadnet AS
#
#               Started out as nginx agent.  Heavily repurposed.
#
# Nginx RA lists these authors: 
#        	Alan Robertson
#		Dejan Muhamedagic

#
# Support:	linux-ha <at> lists.linux-ha.org
(Continue reading)

Dejan Muhamedagic | 16 Aug 2012 11:14

Re: new RA: http_ping

Hi,

On Wed, Aug 15, 2012 at 12:53:33PM +0000, Nicolai Langfeldt wrote:
> Hi,
> 
> I've written a new RA based on what I learnt from the ping and nginx RAs
> for monitoring frontend-proxy-stacks.
> 
> It is attached here for your consideration - and indeed - critique.  I
> am hopeful that it makes it into the pacemaker distribution some time.

Did you consider using the existing monitor facility in the
apache RA? It can be sourced from
/usr/lib/ocf/lib/heartbeat/http-mon.sh
Somebody was already up to this, but it seems like they gave up.
More details here:
https://github.com/ClusterLabs/resource-agents/pull/22

Thanks,

Dejan

> Regards,
>   Nicolai

> #!/bin/sh
> #
> #	High-Availability httpd daemon monitoring OCF agent
> # 
> # nginx
(Continue reading)

Nicolai Langfeldt | 16 Aug 2012 13:53
Picon

Re: new RA: http_ping

On 2012-08-16 11:14, Dejan Muhamedagic wrote:
> Hi,
> 
> On Wed, Aug 15, 2012 at 12:53:33PM +0000, Nicolai Langfeldt wrote:
>> Hi,
>>
>> I've written a new RA based on what I learnt from the ping and nginx RAs
>> for monitoring frontend-proxy-stacks.
>>
>> It is attached here for your consideration - and indeed - critique.  I
>> am hopeful that it makes it into the pacemaker distribution some time.
> 
> Did you consider using the existing monitor facility in the
> apache RA? It can be sourced from
> /usr/lib/ocf/lib/heartbeat/http-mon.sh
> Somebody was already up to this, but it seems like they gave up.
> More details here:
> https://github.com/ClusterLabs/resource-agents/pull/22

Didn't.  Looked at the ping/pingd and nginx RAs.  Grepped and googled a
bit.  http-mon.sh isn't in the Ubuntu resource-agents 1:3.9.2-5ubuntu4.1
package (as found ubuntu 12.04) and I never pulled from github.  Pulled
together http_ping.

It works, it's complete from my point of view.  It can't start or stop
anything, but it can monitor any http (or https) service that's not
managed by the cluster and set attrd attributes based on that to aid
location rules.

Nicolai
(Continue reading)

Dejan Muhamedagic | 16 Aug 2012 15:01

Re: new RA: http_ping

On Thu, Aug 16, 2012 at 11:53:45AM +0000, Nicolai Langfeldt wrote:
> On 2012-08-16 11:14, Dejan Muhamedagic wrote:
> > Hi,
> > 
> > On Wed, Aug 15, 2012 at 12:53:33PM +0000, Nicolai Langfeldt wrote:
> >> Hi,
> >>
> >> I've written a new RA based on what I learnt from the ping and nginx RAs
> >> for monitoring frontend-proxy-stacks.
> >>
> >> It is attached here for your consideration - and indeed - critique.  I
> >> am hopeful that it makes it into the pacemaker distribution some time.
> > 
> > Did you consider using the existing monitor facility in the
> > apache RA? It can be sourced from
> > /usr/lib/ocf/lib/heartbeat/http-mon.sh
> > Somebody was already up to this, but it seems like they gave up.
> > More details here:
> > https://github.com/ClusterLabs/resource-agents/pull/22
> 
> Didn't.  Looked at the ping/pingd and nginx RAs.  Grepped and googled a
> bit.  http-mon.sh isn't in the Ubuntu resource-agents 1:3.9.2-5ubuntu4.1
> package (as found ubuntu 12.04) and I never pulled from github.  Pulled
> together http_ping.

Well, if you're into development, the source repository is your
best friend :)

> It works, it's complete from my point of view.

(Continue reading)

Nicolai Langfeldt | 17 Aug 2012 13:58
Picon

Re: new RA: http_ping

On 2012-08-16 15:01, Dejan Muhamedagic wrote:
>> Didn't.  Looked at the ping/pingd and nginx RAs.  Grepped and googled a
>> bit.  http-mon.sh isn't in the Ubuntu resource-agents 1:3.9.2-5ubuntu4.1
>> package (as found ubuntu 12.04) and I never pulled from github.  Pulled
>> together http_ping.
> 
> Well, if you're into development, the source repository is your
> best friend :)

Watched and forked.

The http-mon.sh file seems to be rather incomplete and not very helpful
from my point of view.

I can easily see how I could refactor my http_ping and cross it with the
apache and nginx RAs to obtain a smaller code base with some common
code.  Would you have a quick look at my http_ping RA and see if I'm
roughly where I should be, or point me at docs that would make me able
to get it there?

To me, as it is a shell script, it seems pretty sane, but I've not
actually read any best practices docs.

A idea that germinated a bit while I was doing http_ping was for a
generic "monitor" agent that calls some simple stub scripts and only
takes care of token and locking management itself.  I'd like it to be
able to do http server and process watching.

Nicolai
_______________________________________________
(Continue reading)

Dejan Muhamedagic | 17 Aug 2012 19:04

Re: [Pacemaker] new RA: http_ping

On Fri, Aug 17, 2012 at 11:58:41AM +0000, Nicolai Langfeldt wrote:
> On 2012-08-16 15:01, Dejan Muhamedagic wrote:
> >> Didn't.  Looked at the ping/pingd and nginx RAs.  Grepped and googled a
> >> bit.  http-mon.sh isn't in the Ubuntu resource-agents 1:3.9.2-5ubuntu4.1
> >> package (as found ubuntu 12.04) and I never pulled from github.  Pulled
> >> together http_ping.
> > 
> > Well, if you're into development, the source repository is your
> > best friend :)
> 
> Watched and forked.
> 
> The http-mon.sh file seems to be rather incomplete and not very helpful
> from my point of view.

The code is several years old. It is used by the apache RA. It
would be excellent if you could offer some constructive critique.
Which part is incomplete? In which way do you find it unhelpful:
the implementation or the interface? Or something else?

> I can easily see how I could refactor my http_ping and cross it with the
> apache and nginx RAs to obtain a smaller code base with some common
> code.  Would you have a quick look at my http_ping RA and see if I'm
> roughly where I should be, or point me at docs that would make me able
> to get it there?

There is a RA development guide:
http://www.linux-ha.org/doc/dev-guides/ra-dev-guide.html

> To me, as it is a shell script, it seems pretty sane, but I've not
(Continue reading)


Gmane