diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/client.pp | 25 | ||||
-rw-r--r-- | manifests/plugin.pp | 2 |
2 files changed, 20 insertions, 7 deletions
diff --git a/manifests/client.pp b/manifests/client.pp index c59369b..48d2a22 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -38,13 +38,26 @@ define munin::register() } } -define munin::register_snmp() +# snmp_testplugin: the plugin we use to test if it's set +define munin::register_snmp( + $snmpd_testplugin = 'load' +) { - @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", - ensure => present, - content => template("munin/snmpclient.erb"), - tag => 'munin', - } + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + exec{"register_snmp_munin_for_${name}": + command => "munin-node-configure-snmp ${name} | sh", + unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", + } + @@file { "munin_snmp_${name}": path => "${NODESDIR}/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + tag => 'munin', + } } class munin::client::base { diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c8d0bc3..6dfe5f0 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -138,7 +138,7 @@ class munin::plugins::base { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: source => "puppet://$server/common/empty", - ignore => '\.ignore', + ignore => [ '\.ignore', 'snmp_*' ], ensure => directory, checksum => mtime, recurse => true, purge => true, force => true, mode => 0755, owner => root, group => 0, |