Merge pull request #6 from jamesp9/plugins

enable common plugins on a node
This commit is contained in:
Forrest 2015-10-01 21:50:39 -07:00
commit 6612930c6a
4 changed files with 38 additions and 0 deletions

View File

@ -39,6 +39,13 @@ Includes ``munin.node``.
Generates a config file for the munin node based on pillar data.
``munin.node.plugins``
----------------------
Includes ``munin.node``.
Symlinks the desired plugins on the munin node based on pillar data.
``munin.tls``
-------------

View File

@ -22,18 +22,21 @@
'service': 'munin-node',
'config': '/etc/munin/munin-node.conf',
'config_src': 'salt://munin/files/munin-node.conf',
'plugin_dir': '/usr/share/munin/plugins',
},
'RedHat': {
'package': 'munin-node',
'service': 'munin-node',
'config': '/etc/munin/munin-node.conf',
'config_src': 'salt://munin/files/munin-node.conf',
'plugin_dir': '/usr/share/munin/plugins',
},
'Arch': {
'package': 'munin-node',
'service': 'munin-node',
'config': '/etc/munin/munin-node.conf',
'config_src': 'salt://munin/files/munin-node.conf',
'plugin_dir': '/usr/lib/munin/plugins',
},
}, merge=salt['pillar.get']('munin_node:lookup')) %}

19
munin/node/plugins.sls Normal file
View File

@ -0,0 +1,19 @@
{% from "munin/map.jinja" import munin_node with context %}
include:
- munin.node
# Enable common plugins
{% for plugin, linked_file in pillar.get('munin_node_common_plugins', {}).items() %}
/etc/munin/plugins/{{ plugin }}:
file.symlink:
- target: {{ munin_node.plugin_dir}}/{{ linked_file }}
- user: root
- group: root
- mode: 755
{% endfor %}
{{ munin_node.service }}:
service.running:
- watch:
- file: /etc/munin/plugins/*

View File

@ -45,3 +45,12 @@ munin_tls:
-----BEGIN CERTIFICATE-----
Inline CA certificate key
-----END CERTIFICATE-----
munin_node_common_plugins:
cpu: cpu
df: df
memory: memory
uptime: uptime
users: users
load: load
if_eth0: if_