Commit 7d044de8 authored by Jerome Charaoui's avatar Jerome Charaoui

Move nagios::service::passive to handler classes so that local backups may also be monitored

parent baead38b
...@@ -138,5 +138,10 @@ define backupninja::duplicity( $order = 90, ...@@ -138,5 +138,10 @@ define backupninja::duplicity( $order = 90,
mode => 0600, mode => 0600,
require => File["${backupninja::configdir}"] require => File["${backupninja::configdir}"]
} }
if $backupninja::manage_nagios {
nagios::service::passive { $nagios_description: }
}
} }
...@@ -80,7 +80,6 @@ define backupninja::rdiff( $order = 90, ...@@ -80,7 +80,6 @@ define backupninja::rdiff( $order = 90,
backuptag => $backuptag, backuptag => $backuptag,
backupkeys => $backupkeystore, backupkeys => $backupkeystore,
keytype => $backupkeytype, keytype => $backupkeytype,
nagios_description => $nagios_description
} }
backupninja::key { "${user}-${name}": backupninja::key { "${user}-${name}":
...@@ -101,5 +100,10 @@ define backupninja::rdiff( $order = 90, ...@@ -101,5 +100,10 @@ define backupninja::rdiff( $order = 90,
mode => 0600, mode => 0600,
require => File["${backupninja::configdir}"] require => File["${backupninja::configdir}"]
} }
if $backupninja::manage_nagios {
nagios::service::passive { $nagios_description: }
}
} }
...@@ -101,7 +101,6 @@ define backupninja::rsync( $order = 90, ...@@ -101,7 +101,6 @@ define backupninja::rsync( $order = 90,
backuptag => $backuptag, backuptag => $backuptag,
keytype => $backupkeytype, keytype => $backupkeytype,
backupkeys => $backupkeystore, backupkeys => $backupkeystore,
nagios_description => $nagios_description
} }
backupninja::key { "${user}-${name}": backupninja::key { "${user}-${name}":
...@@ -121,4 +120,9 @@ define backupninja::rsync( $order = 90, ...@@ -121,4 +120,9 @@ define backupninja::rsync( $order = 90,
mode => 0600, mode => 0600,
require => File["${backupninja::configdir}"] require => File["${backupninja::configdir}"]
} }
if $backupninja::manage_nagios {
nagios::service::passive { $nagios_description: }
}
} }
...@@ -68,14 +68,8 @@ class backupninja::server ( ...@@ -68,14 +68,8 @@ class backupninja::server (
$uid = false, $uid = false,
$gid = "backupninjas", $gid = "backupninjas",
$backuptag = "backupninja-${::fqdn}", $backuptag = "backupninja-${::fqdn}",
$nagios_description = 'backups'
) { ) {
if $backupninja::manage_nagios {
# configure a passive service check for backups
nagios::service::passive { $nagios_description: }
}
if !defined(Backupninja_server_realize["${::fqdn}@${host}"]) { if !defined(Backupninja_server_realize["${::fqdn}@${host}"]) {
@@backupninja_server_realize { "${::fqdn}@${host}": @@backupninja_server_realize { "${::fqdn}@${host}":
host => $::fqdn, host => $::fqdn,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment