Demande #1080
ajout des backups harmine sur puppet
Description
ajouter ce qu'il faut dans source:puppetmaster pour qu'un host s'enregistre aupres de backuppc lorsqu'il est créé
Files
Associated revisions
définition de harmine et backuppc : un serveur backuppc et nrpe
ajout du plugin nrpe sur la definition du server nagios
la classe backuppc::puppetmaster fabrique une clé pour les backups
backuppc::client utilise un script rsync_sender pour que le sudo ait seulement un accès root readonly pour éviter les accidents
refs #1080
the backuppc server asks to be monitored using the standard check_backuppc plugin via nrpe refs #1080
the service name is backuppc, not zfs refs #1080
add a require file to ensure the file for the nagios exported resources is created first refs #1080
ajout de la dépendance du service avec le package nagios3 refs #1080
apt-get install -y rubygems pour préparer le puppetmaster refs #1080
augmente la verbosité de l'installation des gems sur le puppetmaster refs #1080
desactive les tests autre que backuppc refs #1080
installation de nagios-nrpe-plugin sur nagios server au lieu du serveur refs #1080
generation de la clé ssh destinée au backup sur le puppet master refs #1080
la clé destinée aux backup doit appartenir a l'utilisateur puppet refs #1080
la clé destinée aux backup être générée sur le puppet master qui est lui meme un client puppet refs #1080
s/pupet/puppet/ refs #1080
puppet agent exit code does not reflect failure or success refs #1080
change before en require pour s'assurer que le répertoire existe refs #1080
nagios est backup refs #1080
nagios-nrpe-server doit etre restart lorsque la commande check_backuppc est ajoutée sinon il n'en tient pas compte.
la definition de la commande nrpe check_backuppc est mise directement dans le manifest au lieu d'être dans un fichier séparé
refs #1080
ajout du service backuppc qui avait été oublié refs #1080
documentation des tests
lancement des tests unitaires avant les tests d'integration
refs #1080
run puppet on backuppc before starting full backup. Why is it not already defined ?
su to backuppc before starting the full backup
refs #1080
fix misleading comment
refs #1080
installation de nagios-plugins-contrib parceque ce n'est pas fait par défaut dans squeeze et que c'est ce package qui contient check_backuppc
refs #1080
History
Updated by Loïc Dachary about 11 years ago
sp4rky utilise un dérivé de https://github.com/DavidS/puppet-backuppc/blob/master/manifests/init.pp
rodo utilise un module custom
Updated by Loïc Dachary about 11 years ago
Updated by Loïc Dachary about 11 years ago
(10:50:04 AM) dachary: je me demandais si tu pouvais me raconter l'histoire de /usr/local/bin/validate-sudo ou si tu ne sais pas ce que c'est ;-) (10:50:06 AM) raceme: dachary: le validate-sudo c'est du rv2 en fait, perso je fais en root :) (10:50:42 AM) dachary: je ne vais pas summon rv2 (10:50:58 AM) raceme: dachary: je crois que c'est pour ne pas faire du ssh en root et passer le rsync à travers du sudo... Enfin à partir du moment où le compte peut faire sudo et écrire n'importe où en root je ne vois pas trop l'intérêt
Updated by Loïc Dachary about 11 years ago
Discussions de http://people.dunnewind.net/maxence/backuppc.tgz avec maxence et reflexion.
Dedans il y a http://exchange.nagios.org/directory/Plugins/Backup-and-Recovery/BackupPC/check_backuppc_hosts/details
Updated by Loïc Dachary about 11 years ago
http://exchange.nagios.org/directory/Plugins/Backup-and-Recovery/BackupPC/check_backuppc_shares/details
est plus moderne mais traite de cas plus complexes ( subshares ) et n'a pas de tests associés
Updated by Loïc Dachary about 11 years ago
what about using check-mk instead of nrpe to run the backuppc nagios plugin
https://github.com/jthornhill/puppet-checkmk/tree/master/manifests
Updated by Loïc Dachary about 11 years ago
root@nagios:~# dpkg -S /usr/lib/nagios/plugins/check_backuppc
nagios-plugins-contrib: /usr/lib/nagios/plugins/check_backuppc
Updated by Loïc Dachary about 11 years ago
root@harmine:/etc# puppet agent -vt --fqdn harmine.pavot.vm.april-int info: Retrieving plugin info: Loading facts in puppet_vardir info: Loading facts in concat_basedir info: Loading facts in pe_version info: Loading facts in root_home info: Loading facts in puppet_vardir info: Loading facts in concat_basedir info: Loading facts in pe_version info: Loading facts in root_home info: Caching catalog for harmine.pavot.vm.april-int info: Applying configuration version '1355148767' notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Package[nagios-nrpe-server]/ensure: ensure changed 'purged' to 'present' notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/File[/etc/nagios/nrpe.d/backuppc.cfg]/ensure: created info: /Stage[main]//Node[harmine.pavot.vm.april-int]/File[/etc/nagios/nrpe.d/backuppc.cfg]: Scheduling refresh of Service[nagios-nrpe-server] notice: /Stage[main]/Backuppc::Server/File[/var/lib/backuppc/.ssh/abackup]/ensure: defined content as '{md5}007548ad56ddaea2dbc410bccfcdfad5' notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Service[nagios-nrpe-server]/ensure: ensure changed 'stopped' to 'running' notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Service[nagios-nrpe-server]: Triggered 'refresh' from 1 events notice: /Stage[main]/Backuppc::Server/File_line[backuppc_host_nagios.vm.april-int]/ensure: created info: /Stage[main]/Backuppc::Server/File_line[backuppc_host_nagios.vm.april-int]: Scheduling refresh of Service[backuppc] notice: /Stage[main]/Backuppc::Server/Service[backuppc]: Triggered 'refresh' from 1 events --- /etc/vim/vimrc.local 2012-12-04 02:08:55.000000000 +0100 +++ /tmp/puppet-file20121210-14168-8to8np-0 2012-12-10 15:28:19.853038848 +0100 @@ -1,6 +1,6 @@ " " DO NOT CHANGE : IT WILL BE OVERRIDEN BY PUPPET ON THE NEXT RUN -" GENERATED FROM puppet.vm.april-int:/etc/puppet/files/vimrc.local +" GENERATED FROM puppet.vm.april-int:/etc/puppet/modules/vim/files/vimrc.local " syntax on set paste info: FileBucket adding /etc/vim/vimrc.local as {md5}adcc712e1cbd3a9a11fec7105ba3783c info: /Stage[main]/Vim/File[/etc/vim/vimrc.local]: Filebucketed /etc/vim/vimrc.local to puppet with sum adcc712e1cbd3a9a11fec7105ba3783c notice: /Stage[main]/Vim/File[/etc/vim/vimrc.local]/content: content changed '{md5}adcc712e1cbd3a9a11fec7105ba3783c' to '{md5}2e31556d175342cc9633b30a8737297c' notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/Package[sudo]/ensure: ensure changed 'purged' to 'present' notice: /Stage[main]//Node[harmine.pavot.vm.april-int]/File_line[sudo_backuppc]/ensure: created notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: executed successfully notice: /Stage[main]/Backuppc::Server/File[config_file_nagios.vm.april-int]/ensure: created --- /root/.bashrc 2012-12-04 02:09:07.000000000 +0100 +++ /tmp/puppet-file20121210-14168-uy6v9m-0 2012-12-10 15:28:27.388539245 +0100 @@ -1,6 +1,6 @@ # # DO NOT CHANGE : IT WILL BE OVERRIDEN BY PUPPET ON THE NEXT RUN -# GENERATED FROM puppet.vm.april-int:/etc/puppet/files/.bashrc +# GENERATED FROM puppet.vm.april-int:/etc/puppet/modules/bash/files/.bashrc # export HISTCONTROL=ignoredups # Ne pas conserver plusieurs fois de suite la même commande dans l'historique. if [ -f /etc/bash_completion ]; then @@ -13,3 +13,10 @@ fi export HISTSIZE=500000 export PROMPT_COMMAND='history -a' + +alias dpkg-source="dpkg -l | awk '/^.i/ {print \$2}' | xargs apt-cache policy | awk '/^[a-z0-9\-]+:/ {pkg=\$1}; /\*\*\*/ {OFS=\"\t\"; ver=\$2; getline; print pkg,ver,\$2,\$3}'" +# +# For vserver hosts +# +alias upgrade_all='vapt-get --all -- update ; vapt-get --all upgrade && vapt-get --all dist-upgrade; vapt-get --all clean; apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get clean' +alias run_all='vsomething vserver --running --all -- exec ' info: FileBucket adding /root/.bashrc as {md5}8e6fea1fb8950ebfdf798e1186b4aec7 info: /Stage[main]/Bash/File[/root/.bashrc]: Filebucketed /root/.bashrc to puppet with sum 8e6fea1fb8950ebfdf798e1186b4aec7 notice: /Stage[main]/Bash/File[/root/.bashrc]/content: content changed '{md5}8e6fea1fb8950ebfdf798e1186b4aec7' to '{md5}e22880457ebb6d9ac06331f5c763adf9' --- /root/.screenrc 2012-12-04 02:09:05.000000000 +0100 +++ /tmp/puppet-file20121210-14168-1owi1j-0 2012-12-10 15:28:27.732041273 +0100 @@ -1,9 +1,8 @@ # # DO NOT CHANGE : IT WILL BE OVERRIDEN BY PUPPET ON THE NEXT RUN -# GENERATED FROM puppet.vm.april-int:/etc/puppet/files/.screenrc +# GENERATED FROM puppet.vm.april-int:/etc/puppet/modules/screen/files/.screenrc # escape ^^^[ hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " - info: FileBucket adding /root/.screenrc as {md5}bc8a0cb710ba8ba34057e0cba5ffc05f info: /Stage[main]/Screen/File[/root/.screenrc]: Filebucketed /root/.screenrc to puppet with sum bc8a0cb710ba8ba34057e0cba5ffc05f notice: /Stage[main]/Screen/File[/root/.screenrc]/content: content changed '{md5}bc8a0cb710ba8ba34057e0cba5ffc05f' to '{md5}161e395e35e791ea2ebf041f4764a8fb' notice: Finished catalog run in 26.28 seconds
Updated by Loïc Dachary about 11 years ago
sur harmine il faut prendre augeas-tools de backports
apt-get install augeas-tools=0.10.0-1~bpo60+3 libaugeas0=0.10.0-1~bpo60+3 augeas-lenses=0.10.0-1~bpo60+3
sinon il n'y a pas la lens qui va bien pour nrpe.cfg
Updated by Loïc Dachary about 11 years ago
- Status changed from En cours de traitement to Résolu
- % Done changed from 0 to 100
Updated by Loïc Dachary almost 11 years ago
- Subject changed from ajout des backups sur puppet to ajout des backups harmine sur puppet
implémentation initiale dans l'idée d'ajouter, pour domain.com une ligne dans le fichier /etc/backuppc/hosts, un fichier domain.com.pl sur le serveur backuppc et un utilisateur sudo sur la machine cliente qui autorise le serveur a venir faire le backup refs #1080