From 8e874720bf878a09a425d3323095202b1ca36846 Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Thu, 4 Aug 2011 14:19:39 +0200 Subject: Also provide port for snmp nodes --- manifests/register/snmp.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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", -- cgit v1.2.3