]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
replace koumbit-specific nagios server configuration with a $nagios_server variable...
authorMicah Anderson <micah@riseup.net>
Mon, 7 Dec 2009 22:03:59 +0000 (17:03 -0500)
committerMicah Anderson <micah@riseup.net>
Mon, 7 Dec 2009 22:03:59 +0000 (17:03 -0500)
README
manifests/server.pp

diff --git a/README b/README
index 3b732009c588d2d867a8b1f8131d040be5c02d3c..5cec60dbc8d96efb85ba87b72347daf4b70748b0 100644 (file)
--- a/README
+++ b/README
@@ -65,4 +65,14 @@ and create them.  We have yet to create proper authorized_keys
 management to make that process completely automatic.
 
 At the moment, not all the backupninja handlers are available, they
-are relatively easy to add however.
\ No newline at end of file
+are relatively easy to add however.
+
+Nagios alerts about backup freshness
+------------------------------------
+
+If you set the $nagios_server variable to be the name of your nagios server,
+then a passive nagios service gets setup so that the backup server pushes
+checks, via a cronjob that calls /usr/local/bin/checkbackups.pl, to the
+nagios server to alert about relative backup freshness.
+
+Note: this $nagios_server variable must be set before the class is included.
\ No newline at end of file
index 9db950acbe8f6836800edbf74a1f59a7c4c22c0c..5eb2e15718b0e3cb83f8e2b39adb920ffdc69bca 100644 (file)
@@ -12,7 +12,7 @@ class backupninja::server {
     '' => $fqdn,
     default => $backupserver_tag
   }
-
+  
   group { "backupninjas":
     ensure => "present",
     gid => 700
@@ -29,12 +29,14 @@ class backupninja::server {
     mode => 0755, owner => root, group => root,
   }
 
-  cron { checkbackups:
-    command => "/usr/local/bin/checkbackups -d $real_backupdir | /usr/sbin/send_nsca -H nagios.koumbit.net -c /etc/send_nsca.cfg | grep -v 'sent to host successfully'",
-    user => "root",
-    hour => "8-23",
-    minute => 59,
-    require => [ File["/usr/local/bin/checkbackups"], Package['nsca'] ]
+  if $nagios_server {
+    cron { checkbackups:
+      command => "/usr/local/bin/checkbackups -d $real_backupdir | /usr/sbin/send_nsca -H $real_nagios_server -c /etc/send_nsca.cfg | grep -v 'sent to host successfully'",
+      user => "root",
+      hour => "8-23",
+      minute => 59,
+      require => [ File["/usr/local/bin/checkbackups"], Package['nsca'] ]
+    }
   }
 
   User <<| tag == "backupninja-$real_backupserver_tag" |>>
@@ -81,10 +83,12 @@ class backupninja::server {
       false => "backupninja-$real_host",
       default => $backuptag,
     }
-      
-    # configure a passive service check for backups
-    nagios2::passive_service { "backups-$real_host": nagios2_host_name => $real_host, nagios2_description => 'backups', servicegroups => "backups" }
 
+    if $nagios_server {
+      # configure a passive service check for backups
+      nagios2::passive_service { "backups-$real_host": nagios2_host_name => $real_host, nagios2_description => 'backups', servicegroups => "backups" }
+    }
+    
     if !defined(File["$real_dir"]) {
       @@file { "$real_dir":
         ensure => directory,