aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 15:40:10 -0400
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 17:12:16 -0400
commit7e1b74289498a4adcc202191378477a65164ad2b (patch)
tree28a274666dd0c2536851f82757b5efbc74dddfde
parent8d97365688f59a8990fa549d0a0cc227d1187e76 (diff)
downloadpuppet-backupninja-7e1b74289498a4adcc202191378477a65164ad2b.tar.gz
puppet-backupninja-7e1b74289498a4adcc202191378477a65164ad2b.tar.bz2
Fix nagios stuff in server class
-rw-r--r--manifests/server.pp9
1 files changed, 7 insertions, 2 deletions
diff --git a/manifests/server.pp b/manifests/server.pp
index 19e0b25..6346a62 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -9,7 +9,8 @@ class backupninja::server (
$backupdir = '/backup',
$backupdir_ensure = 'directory',
$backupserver_tag = $::fqdn,
- $manage_nagios = false
+ $manage_nagios = false,
+ $nagios_server = undef
) {
group { "backupninjas":
@@ -28,6 +29,10 @@ class backupninja::server (
if $manage_nagios {
+ if $nagios_server == undef {
+ fail('Cannot manage nagios with undefined nagios_server parameter!')
+ }
+
include nagios::nsca::client
file { "/usr/local/bin/checkbackups":
@@ -37,7 +42,7 @@ class backupninja::server (
}
cron { checkbackups:
- command => "/usr/local/bin/checkbackups -d $real_backupdir | /usr/sbin/send_nsca -H $nagios_server -c /etc/send_nsca.cfg | grep -v 'sent to host successfully'",
+ command => "/usr/local/bin/checkbackups -d $backupdir | /usr/sbin/send_nsca -H $nagios_server -c /etc/send_nsca.cfg | grep -v 'sent to host successfully'",
user => "root",
hour => "8-23",
minute => 59,