summaryrefslogtreecommitdiff
path: root/manifests/register_snmp.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-09-29 22:51:15 +0200
committermh <mh@immerda.ch>2009-09-29 22:51:15 +0200
commit1893960c1babb6a261cc6fc399231e9c0644a104 (patch)
tree7e4fb1f3d2d34490b8d5cfff50d6f9cadf890fb9 /manifests/register_snmp.pp
parentc63a28d3c16ec2bb3a46d3d5faf6d7ef3b737b70 (diff)
refactor everything into its own file
Diffstat (limited to 'manifests/register_snmp.pp')
-rw-r--r--manifests/register_snmp.pp21
1 files changed, 21 insertions, 0 deletions
diff --git a/manifests/register_snmp.pp b/manifests/register_snmp.pp
new file mode 100644
index 0000000..e74ba44
--- /dev/null
+++ b/manifests/register_snmp.pp
@@ -0,0 +1,21 @@
+# snmp_testplugin: the plugin we use to test if it's set
+define munin::register_snmp(
+ $snmpd_testplugin = 'load'
+)
+{
+ $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 => "/var/lib/puppet/modules/munin/nodes/${name}",
+ ensure => present,
+ content => template("munin/snmpclient.erb"),
+ tag => 'munin',
+ }
+}