summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjen Heidinga <dexter@beetjevreemd.nl>2014-01-31 09:52:10 +0100
committermh <mh@immerda.ch>2014-02-03 14:54:50 +0100
commit695d81c81cd152b5dd7333d0eae2bd6df108a41e (patch)
tree79d41aad7774dda2c739bb0a6938dcb8d7878aa7
parent0ebbe54879941e886dc1519b7dfdc69f614975ad (diff)
Add support for setting the descryption and group support
-rw-r--r--manifests/client.pp14
-rw-r--r--manifests/client/base.pp12
-rw-r--r--manifests/client/params.pp2
-rw-r--r--manifests/register.pp3
-rw-r--r--templates/client.erb4
5 files changed, 20 insertions, 15 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 2d4c82b..6614709 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -4,13 +4,15 @@
# configure a munin node
class munin::client(
- $allow = [ '127.0.0.1' ],
- $host = '*',
- $port = '4949',
- $use_ssh = false,
- $manage_shorewall = false,
+ $allow = [ '127.0.0.1' ],
+ $host = '*',
+ $port = '4949',
+ $use_ssh = false,
+ $manage_shorewall = false,
$shorewall_collector_source = 'net',
- $export_tag = 'munin'
+ $export_tag = 'munin',
+ $description = 'absent',
+ $munin_group = 'absent',
) {
case $::operatingsystem {
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 71531fa..d35d742 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -31,11 +31,13 @@ class munin::client::base inherits munin::client::params {
default => $munin::client::host
}
munin::register { $::fqdn:
- host => $host,
- port => $munin::client::port,
- use_ssh => $munin::client::use_ssh,
- config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
- export_tag => $munin::client::export_tag,
+ host => $host,
+ port => $munin::client::port,
+ use_ssh => $munin::client::use_ssh,
+ description => $munin::client::description,
+ group => $munin::client::munin_group,
+ config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
+ export_tag => $munin::client::export_tag,
}
include munin::plugins::base
}
diff --git a/manifests/client/params.pp b/manifests/client/params.pp
index 14d3749..4473912 100644
--- a/manifests/client/params.pp
+++ b/manifests/client/params.pp
@@ -2,7 +2,7 @@
class munin::client::params {
$user = 'root'
- case $::operatingsystem {
+ case $::osfamily {
'OpenBSD': {
$group = '0'
$log_file = '/var/log/munin-node/munin-node.log'
diff --git a/manifests/register.pp b/manifests/register.pp
index 1f6d787..f0567d7 100644
--- a/manifests/register.pp
+++ b/manifests/register.pp
@@ -5,7 +5,8 @@ define munin::register (
$use_ssh = false,
$description = 'absent',
$config = [],
- $export_tag = 'munin'
+ $export_tag = 'munin',
+ $group ='absent',
)
{
$fhost = $name
diff --git a/templates/client.erb b/templates/client.erb
index 83d5a64..5741701 100644
--- a/templates/client.erb
+++ b/templates/client.erb
@@ -9,9 +9,9 @@
# Registered on: <%= @h %>
# Type: <%= @client_type %>
<% if @description != 'absent' -%>
-# Description: <%= @description.gsub!(/\n/, ' ') %>
+# Description: <%= @description.gsub(/\n/, ' ') %>
<% end -%>
-[<%= @fhost.downcase %>]
+[<% if @group != 'absent' -%><%= @group %>;<% end -%><%= @fhost.downcase %>]
<% if @use_ssh -%>
address ssh://<%= @host %>/bin/nc localhost <%= @port %>
<% else -%>