enable common plugins on node
This commit is contained in:
parent
3aef93425b
commit
6649db745a
@ -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``
|
||||
-------------
|
||||
|
||||
|
@ -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
19
munin/node/plugins.sls
Normal 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/*
|
@ -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_
|
||||
|
Loading…
Reference in New Issue
Block a user