summaryrefslogtreecommitdiff
path: root/manifests/client.pp
diff options
context:
space:
mode:
authorMarcel Haerry <haerry@puzzle.ch>2009-04-15 12:00:48 +0200
committerMarcel Haerry <haerry@puzzle.ch>2009-04-15 12:00:48 +0200
commitac4b2be1fac6ec7893a166fec0a065fb943c8e5f (patch)
tree225a9b98c9b041ac571abe31bf5a4590dcf939f6 /manifests/client.pp
parent93be07edbcea844e2efe56191cda62bf44b6654c (diff)
finally implemented snmp client
Diffstat (limited to 'manifests/client.pp')
-rw-r--r--manifests/client.pp26
1 files changed, 20 insertions, 6 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 9a7b772..f2046fb 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -38,13 +38,27 @@ 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"),
+ require => Exec["register_snmp_munin_for_${name}"],
+ tag => 'munin',
+ }
}
class munin::client::base {