summaryrefslogtreecommitdiff
path: root/manifests/register
diff options
context:
space:
mode:
authorMarcel Haerry <haerry@puzzle.ch>2011-08-04 14:19:39 +0200
committerMarcel Haerry <haerry@puzzle.ch>2011-08-04 14:19:39 +0200
commit8e874720bf878a09a425d3323095202b1ca36846 (patch)
tree0cad928c8395426831ef5fad474be10531b27517 /manifests/register
parent568fa47b11489b7ec7cac556e6927017f6cc8cc7 (diff)
Also provide port for snmp nodes
Diffstat (limited to 'manifests/register')
-rw-r--r--manifests/register/snmp.pp11
1 files changed, 10 insertions, 1 deletions
diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp
index 5a1f42d..c45adb0 100644
--- a/manifests/register/snmp.pp
+++ b/manifests/register/snmp.pp
@@ -1,6 +1,7 @@
define munin::register::snmp (
$community = 'public',
- $description = 'absent'
+ $description = 'absent',
+ $port = 'absent'
)
{
$fhost = $name
@@ -8,6 +9,14 @@ define munin::register::snmp (
$client_type = 'snmp'
$config = [ 'use_node_name no' ]
+ $munin_port_real = $port ? {
+ 'absent' => $munin_port ? {
+ '' => 4949,
+ default => $munin_port
+ },
+ default => $port
+ }
+
exec { "munin_register_snmp_${fhost}":
command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh",
unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null",