Added define munin::snmpnode for configuring Munin SNMP gateway.
This commit is contained in:
parent
70c8c35ef1
commit
f4d2fcfd1a
1 changed files with 41 additions and 0 deletions
|
@ -54,6 +54,47 @@ class munin::node {
|
|||
}
|
||||
|
||||
|
||||
# Configure SNMP node.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# Target SNMP host.
|
||||
# $snmp_community:
|
||||
# SNMP community. Defaults to public.
|
||||
# $snmp_version:
|
||||
# SNMP version. Defaults to 2.
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
# munin::snmpnode { "sw1.example.com":
|
||||
# $snmp_community => "mycommunity",
|
||||
# }
|
||||
#
|
||||
define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
||||
|
||||
file { "/etc/munin/plugin-conf.d/snmp_${name}":
|
||||
content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n",
|
||||
ensure => present,
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
mode => 0600,
|
||||
notify => Service["munin-node"],
|
||||
}
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${name}.conf":
|
||||
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
|
||||
ensure => present,
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Add new custom munin plugin.
|
||||
#
|
||||
# === Parameters
|
||||
|
|
Loading…
Add table
Reference in a new issue