On 30 December 2010 23:41, Nick Anderson <n...@cmdln.org> wrote:
> On Thu, Dec 30, 2010 at 10:42:59PM +0100, Erlend Leganger wrote:
>> I have a simple setup where all servers (<30) are on the same LAN. The
>> policies include heartbeat promise which always evaluates to true, this
>> promise runs a heartbeat script which updates a data file per server on a
>> common NFS share. By changing the heartbeat script (it's distributed using
>> cfengine) I can leave all kinds of information per server on the common NFS
>> share and then query these files for the information I need. Currently, I
>> only use this to check that cfengine in fact is running on all servers I
>> expect it to run on.
>> This setup is very crude, requires access to a writable NFS share and does
>> not scale well, but it works for me.
>
> That design pattern could be used to make an http call back to some
> centralized location and record information in a database or even just
> use http put to drop it into a file, similiar to how you are using the
> nfs server, that would free you from the need to have that one nfs
> server mounted everywhere.

Heh, you learn something new every day... I configured my Apache
server and made a PUT handler as described in [1], then I can use curl
on the client to upload files:

curl --request PUT --upload-file heartbeat.txt
-Hheartbeatfile:$(hostname)-heartbeat.txt
http://localhost/cgi-bin/put-heartbeat.pl

The -Hheartbeatfile stuff is something I invented to pass a file name
to the CGI-script.

Now suddenly this became a solution that can be deployed across WAN
links and is as scalable as the target web server - nice!

Thanks,
Erlend

[1]: http://www.apacheweek.com/features/put
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to