]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
add checkbackups cron job, fix multiple instances of passive service for manually...
authorAntoine Beaupre <anarcat@koumbit.org>
Tue, 6 Jan 2009 21:49:37 +0000 (16:49 -0500)
committerAntoine Beaupre <anarcat@koumbit.org>
Tue, 6 Jan 2009 21:49:37 +0000 (16:49 -0500)
manifests/server.pp

index 60332490434a57787102edb922f80d78e6f7ae24..e4ed80a3be2f6e8437bca13a0f3aebce7ae788c7 100644 (file)
@@ -23,6 +23,20 @@ class backupninja::server {
     mode => 0710, owner => root, group => "backupninjas"
   }
   
+  file { "/usr/local/bin/checkbackups":
+    ensure => "present",
+    content => template("backupninja/checkbackups.sh"),
+    mode => 0755, owner => root, group => root,
+  }
+
+  cron { checkbackups:
+    command => "/usr/local/bin/checkbackups.sh | /usr/sbin/send_nsca -H nagios.koumbit.net -c /etc/send_nsca.cfg",
+    user => "root",
+    hour => 8,
+    minute => 0,
+    require => [ File["/usr/local/bin/checkbackups"], Package['nsca'] ]
+  }
+
   User <<| tag == "backupninja-$real_backupserver_tag" |>>
   File <<| tag == "backupninja-$real_backupserver_tag" |>>
   Ssh_authorized_key <<| tag == "backupninja-$real_backupserver_tag" |>>
@@ -63,10 +77,13 @@ class backupninja::server {
       default => $authorized_keys_file,
     }
     $real_backuptag = $backuptag ? {
-      false => "backupninja-$real_host",
+      false => "backupninja-$fqdn",
       default => $backuptag,
     }
       
+    # configure a passive service check for backups
+    nagios2::passive_service { "backups-$real_host": nagios2_host_name => $real_host, nagios2_description => 'backups' }
+
     @@file { "$real_dir":
       ensure => directory,
       mode => 0750, owner => $real_user, group => 0,