From aaf55c9ebfa0e34f63b2ca3c2b660e1d164026dd Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 6 May 2013 18:13:12 +0200 Subject: lintify --- manifests/register/snmp.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'manifests/register') diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index 78c3e91..06bb00b 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -1,3 +1,4 @@ +# Register a munin node with snmp enabled define munin::register::snmp ( $community = 'public', $description = 'absent', @@ -10,12 +11,12 @@ define munin::register::snmp ( exec { "munin_register_snmp_${fhost}": command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh", - unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null", + unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null", } @@concat::fragment{ "munin_snmp_${fhost}": - target => '/etc/munin/munin.conf', - content => template("munin/client.erb"), - tag => 'munin', + target => '/etc/munin/munin.conf', + content => template('munin/client.erb'), + tag => 'munin', } } -- cgit v1.2.3 From 145f35c188b088890049557be6f203272f0d266c Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 13 Aug 2014 10:34:21 +0200 Subject: Unbreak registring snmp hosts; Exec{} needs a path --- manifests/register/snmp.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'manifests/register') diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index 06bb00b..1c375ec 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -12,6 +12,7 @@ define munin::register::snmp ( exec { "munin_register_snmp_${fhost}": command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh", unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null", + path => ['/bin','/sbin','/usr/bin','/usr/sbin','/usr/local/bin','/usr/local/sbin'], } @@concat::fragment{ "munin_snmp_${fhost}": -- cgit v1.2.3 From 68e5a30c917a9275868e609fe986e6424ab1c1eb Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 13 Aug 2014 10:35:18 +0200 Subject: Unbreak registering new snmp nodes into munin.conf As $group would be undefined, a ';' would be written into the host definition which in turn causes munin to be unable to parse the file. --- manifests/register/snmp.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manifests/register') diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index 1c375ec..5fab221 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -3,7 +3,8 @@ define munin::register::snmp ( $community = 'public', $description = 'absent', $port = '4949', - $host = $::fqdn + $host = $::fqdn, + $group = 'absent', ) { $fhost = $name $client_type = 'snmp' -- cgit v1.2.3 From 5d5a542c58fc6218af6d210cf9f454da54622d1e Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 13 Aug 2014 10:38:14 +0200 Subject: spacing --- manifests/register/snmp.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'manifests/register') diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index 5fab221..f84785a 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -1,10 +1,10 @@ # Register a munin node with snmp enabled define munin::register::snmp ( - $community = 'public', + $community = 'public', $description = 'absent', - $port = '4949', - $host = $::fqdn, - $group = 'absent', + $port = '4949', + $host = $::fqdn, + $group = 'absent', ) { $fhost = $name $client_type = 'snmp' -- cgit v1.2.3 From 043502d650e76ea604ef4f2e23ce2f0112f5706f Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Wed, 13 Aug 2014 22:42:47 +0200 Subject: Allow setting an snmpversion for plugin discovery --- manifests/register/snmp.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manifests/register') diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index f84785a..d3761ae 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -5,13 +5,14 @@ define munin::register::snmp ( $port = '4949', $host = $::fqdn, $group = 'absent', + $version = '2', ) { $fhost = $name $client_type = 'snmp' $config = [ 'use_node_name no' ] exec { "munin_register_snmp_${fhost}": - command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh", + command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --snmpversion ${version} --shell | sh", unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null", path => ['/bin','/sbin','/usr/bin','/usr/sbin','/usr/local/bin','/usr/local/sbin'], } -- cgit v1.2.3 From 3b113bd7f8be9f766f5a15933ff5574f6b124163 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 13 Sep 2014 05:17:52 +0200 Subject: Revert "Unbreak registring snmp hosts; Exec{} needs a path" http://www.puppetcookbook.com/posts/set-global-exec-path.html This reverts commit 145f35c188b088890049557be6f203272f0d266c. --- manifests/register/snmp.pp | 1 - 1 file changed, 1 deletion(-) (limited to 'manifests/register') diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index d3761ae..8d7ea56 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -14,7 +14,6 @@ define munin::register::snmp ( exec { "munin_register_snmp_${fhost}": command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --snmpversion ${version} --shell | sh", unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null", - path => ['/bin','/sbin','/usr/bin','/usr/sbin','/usr/local/bin','/usr/local/sbin'], } @@concat::fragment{ "munin_snmp_${fhost}": -- cgit v1.2.3