Distributing plugins

Mathieu Grzybek grzybek.mathieu at ig2i.fr
Wed Aug 29 18:50:20 CEST 2007


Hi list,

If you have a huge number of servers to monitor, cfengine can help you 
to update files and to do some common tasks.
It becomes easy to upgrade your config files and your plugins.

Mathieu

Thomas Guyot-Sionnest a écrit :
> Andreas Ericsson wrote:
>   
>> francois basquin wrote:
>>     
>>> I often write new plugins, and I face a distribution problem: how to 
>>> distribute them without having to scp and editing nrpe.cfg on each server?
>>>
>>>       
>> With keys and a script, this becomes a very trivial problem.
>> for srv in $(cat server-list); do
>> 	scp plugin root@$srv/path/to/plugins
>> 	scp nrpe.cfg root@$srv/etc/nrpe.cfg
>> 	ssh root@$srv /etc/init.d/nrpe restart
>> done
>>     
>
> Agreed. To go further I made a /etc/nrpe directory on my servers where I
> can put various "role-based" and private config files (There's no
> command definitions in the main nrpe.cfg file).
>
> I.e. on the same server I can have one config file for all Linux server,
> one for all web server, one for a certain type of web server, and  a
> server-specific config file.
>
>
> I have not yet written any script to push the general configs (takes
> seconds to get the server list and write my own for loop) but here's
> what I use fro the private config:
>
>
> #!/bin/bash
>
> if [ "x$1" = "x-h" -o "x$1" = "x--help" ]; then
>   echo -e "$0\n\tPush all private configs"
>   echo -e "$0 <host1> [<host2>] [<host3>]\n\tPush private configs only
> to specified hosts"
>   echo -e "\nIn all cases the remote NRPE client is HUP'ed to reload the
> config.\n"
>   exit
> fi
>
> if [ -z "$*" ]; then
>   SERVLIST=`ls _private.cfg.*|cut -d. -f3-`
> else
>   SERVLIST=$*
> fi
>
> for server in $SERVLIST; do
>   scp _private.cfg.$server $server:/etc/nrpe/_private.cfg
>   ssh $server killall -HUP nrpe
>   echo $server: Done.
> done
>
>
> Basically you have files in the form _private.cfg.<servername> and use
> the script to either push to a list of servers on the command line or
> push them all.
>
>   




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/




More information about the Developers mailing list