diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-03-06 16:47:08 -0500 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-03-06 16:47:08 -0500 |
commit | 1ef94f1f2e49e032c6c416830345fc3b4beacb01 (patch) | |
tree | 4c6bc037e48bcfc75412d86f638e2cdbc118d8c7 /manifests/nagios_plugin | |
parent | fa28702f46db802494872272ca50e0b1c37de09e (diff) | |
parent | bab96a631337b87dd6f168f663f5b24537f58a5c (diff) | |
download | puppet-backupninja-1ef94f1f2e49e032c6c416830345fc3b4beacb01.tar.gz puppet-backupninja-1ef94f1f2e49e032c6c416830345fc3b4beacb01.tar.bz2 |
Merge branch 'master' of https://git-nadir.immerda.ch/puppet-backupninja
Conflicts:
manifests/rdiff.pp
Diffstat (limited to 'manifests/nagios_plugin')
-rw-r--r-- | manifests/nagios_plugin/duplicity.pp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/manifests/nagios_plugin/duplicity.pp b/manifests/nagios_plugin/duplicity.pp new file mode 100644 index 0000000..7dbd263 --- /dev/null +++ b/manifests/nagios_plugin/duplicity.pp @@ -0,0 +1,45 @@ +class backupninja::nagios_plugin::duplicity { + case $::operatingsystem { + 'Debian': { package { 'python-argparse': ensure => installed, } } + 'Ubuntu': { package { 'python-argh': ensure => installed, } } + default: { + notify {'Backupninja-Duplicity Nagios check needs python-argparse to be installed !':} } + } + + file { '/usr/lib/nagios/plugins/check_backupninja_duplicity.py': + source => 'puppet:///modules/backupninja/nagios_plugins/duplicity/check_backupninja_duplicity.py', + mode => '0755', + owner => 'nagios', + group => 'nagios', + } + + # deploy helper script + file { '/usr/lib/nagios/plugins/backupninja_duplicity_freshness.sh': + source => 'puppet:///modules/backupninja/nagios_plugins/duplicity/backupninja_duplicity_freshness.sh', + mode => '0755', + owner => 'nagios', + group => 'nagios', + } + + nagios::nrpe::command { 'check_backupninja_duplicity': + command_line => "sudo ${::nagios::nrpe::nagios_plugin_dir}/check_backupninja_duplicity.py" + } + sudo::spec {'nrpe_check_backupninja_duplicity': + ensure => present, + users => 'nagios', + hosts => 'ALL', + commands => "NOPASSWD: ${::nagios::nrpe::nagios_plugin_dir}/check_backupninja_duplicity.py"; + } + + nagios::service { "Backupninja Duplicity $::fqdn": + use_nrpe => true, + check_command => 'check_backupninja_duplicity', + nrpe_timeout => '60', + # check only twice a day + normal_check_interval => '720', + # recheck every hour + retry_check_interval => '60', + } + + +} |