summaryrefslogtreecommitdiff
path: root/puppet/modules/backupninja/manifests/nagios_plugin
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-06-09 17:31:57 +0200
committervarac <varacanero@zeromail.org>2016-06-14 12:05:18 +0200
commit361db68ac73fd2305c43044f9f548178533ad141 (patch)
treee7945c66ce868ab25431c1fcb0162d335b160e89 /puppet/modules/backupninja/manifests/nagios_plugin
parent8f2ffe06dda7cfd21202543abeac90142dc9b322 (diff)
git subrepo clone https://leap.se/git/puppet_backupninja puppet/modules/backupninja
subrepo: subdir: "puppet/modules/backupninja" merged: "5268a87" upstream: origin: "https://leap.se/git/puppet_backupninja" branch: "master" commit: "5268a87" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "cb2995b"
Diffstat (limited to 'puppet/modules/backupninja/manifests/nagios_plugin')
-rw-r--r--puppet/modules/backupninja/manifests/nagios_plugin/duplicity.pp45
1 files changed, 45 insertions, 0 deletions
diff --git a/puppet/modules/backupninja/manifests/nagios_plugin/duplicity.pp b/puppet/modules/backupninja/manifests/nagios_plugin/duplicity.pp
new file mode 100644
index 00000000..7dbd2633
--- /dev/null
+++ b/puppet/modules/backupninja/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',
+ }
+
+
+}