]> gitweb.fluxo.info Git - puppet-virtual.git/commitdiff
Setup plugins just if munin is enabled in the system
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 26 Dec 2009 17:24:59 +0000 (15:24 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 26 Dec 2009 17:24:59 +0000 (15:24 -0200)
manifests/vserver.pp

index 459d1fd54b6c8cc88e4c906feb567a6273f8a005..fe4a822483ce328ef0f79b8215efd6ef535aa0e1 100644 (file)
@@ -70,34 +70,40 @@ class vserver::host {
       mode => 0755, owner => root, group => root;
   }
   
-  # This creates a load average graph combining the individual load averages of each vserver on the host
-  munin::plugin {
-    "vserver_loadavg":
-      config => "user root\n",
-      script_path => "/usr/local/share/munin-plugins";
-  }
-  
-  # This creates a RSS graph for each vserver on the host (note after more than 4 vservers this can get noisy)
-  munin::plugin {
-    "vserver_resources_RSS":
-      ensure => "vserver_resources",
-      config => "user root\nenv.resource RSS",
-      script_path => "/usr/local/share/munin-plugins";
-  }
-  
-  # This creates a VM graph for each vserver on the host (note after more than 4 vservers this can get noisy)
-  munin::plugin {
-    "vserver_resources_VM":
-      ensure => "vserver_resources",
-      config => "user root\nenv.resource VM",
-      script_path => "/usr/local/share/munin-plugins";
-  }
-  
-  # This creates a VM graph for each vserver on the host (note after more than 4 vservers this can get noisy)
-  munin::plugin {
-    "vserver_cpu_":
-      config => "user root\n",
-      script_path => "/usr/local/share/munin-plugins";
+  # Setup some plugins if munin is enabled in the system
+  case $munin_cidr_allow {
+    '': {}
+    default: {
+               # This creates a load average graph combining the individual load averages of each vserver on the host
+               munin::plugin {
+                 "vserver_loadavg":
+                   config => "user root\n",
+                   script_path => "/usr/local/share/munin-plugins";
+               }
+
+               # This creates a RSS graph for each vserver on the host (note after more than 4 vservers this can get noisy)
+               munin::plugin {
+                 "vserver_resources_RSS":
+                   ensure => "vserver_resources",
+                   config => "user root\nenv.resource RSS",
+                   script_path => "/usr/local/share/munin-plugins";
+               }
+
+               # This creates a VM graph for each vserver on the host (note after more than 4 vservers this can get noisy)
+               munin::plugin {
+                 "vserver_resources_VM":
+                   ensure => "vserver_resources",
+                   config => "user root\nenv.resource VM",
+                   script_path => "/usr/local/share/munin-plugins";
+               }
+
+               # This creates a VM graph for each vserver on the host (note after more than 4 vservers this can get noisy)
+               munin::plugin {
+                 "vserver_cpu_":
+                   config => "user root\n",
+                   script_path => "/usr/local/share/munin-plugins";
+               }
+             }
   }
 }