From 695d81c81cd152b5dd7333d0eae2bd6df108a41e Mon Sep 17 00:00:00 2001 From: Arjen Heidinga Date: Fri, 31 Jan 2014 09:52:10 +0100 Subject: Add support for setting the descryption and group support --- manifests/client.pp | 14 ++++++++------ manifests/client/base.pp | 12 +++++++----- manifests/client/params.pp | 2 +- manifests/register.pp | 3 ++- templates/client.erb | 4 ++-- 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 -%> -- cgit v1.2.3