Munin. weitere Plugins + Umbau (#8)

Plugins in eigenes repo

plugin zpool capacity eingefügt

Doku

Squid + noch ein falsches hddtemp entfernt

falsches hddtemp entfernt

eneues taskplugins entfernen

yaml syntax

geerlingguy umgebaut

Doku

Doku

zfs_usage entfernt

Bugfix: munin: zfs_arcstats

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#8
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
Michael Grote 2021-02-27 17:46:29 +01:00
parent 1208cdf09e
commit e25db9f0ff
19 changed files with 87 additions and 378 deletions

View file

@ -26,25 +26,32 @@
- name: hddtemp_smartctl
- name: zpool_iostat
- name: zfsonlinux_stats_
- name: zfsarcstats-counters
- name: zfs_usage_
- name: zfs_arcstats
- name: zfs_list
- name: zpool_capacity
munin_node_config: {
"apc_nis": {
"env.host": "pve2.grote.lan",
"env.port": "3551"
}
}
munin_node_install_plugins:
- remote_src: https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/zfs/zfs_arcstats
- remote_src: https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/zfs/zfs_usage_
- remote_src: https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/zfs/zfsarcstats-counters
- remote_src: https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/zfs/zfsonlinux_stats_
- remote_src: https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/zfs/zpool_iostat
- remote_src: https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/zfs/zfs_list
munin_node_install_plugins: # in eigenes Repo gesichert
- remote_src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/zfs_arcstats
- remote_src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/zfsonlinux_stats_
- remote_src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/zpool_iostat
- remote_src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/zfs_list
- remote_src: https://git.mgrote.net/mg/munin-plugins/raw/branch/master/zpool_capacity
munin_node_remove_plugins:
- name: meminfo # zhohe last
- name: hddtemp2 # ersetzt durch hddtemp_smartctl
- name: squid_cache
- name: squid_objectsize
- name: squid_requests
- name: squid_traffic
- name: nfsd
- name: nfsd4
- name: hddtempd # ersetzt durch hddtemp_smartctl
- name: ipmi_power # für pve2, leeres diagramm
# Ansible Variablen
### sudo
sudo: false

View file

@ -7,4 +7,5 @@
when: "'physical' in group_names" }
### Die Host müssen auch beim Docker-Container: "munin-master eingetragen" werden.
### wird nur auf physichen Rechnern ausgeführt.
### wird nur auf physischen Rechnern ausgeführt.
### Wenn ein Plugin nicht geht: munin-node-configure --shell --families=contrib,auto | sh -x

View file

@ -1,3 +0,0 @@
skip_list:
- 'yaml'
- 'role-name'

View file

@ -1,4 +0,0 @@
# These are supported funding model platforms
---
github: geerlingguy
patreon: geerlingguy

View file

@ -1,56 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 90
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 30
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
- planned
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false
# Label to use when marking as stale
staleLabel: stale
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
pulls:
markComment: |-
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
unmarkComment: >-
This pull request is no longer marked for closure.
closeComment: >-
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
issues:
markComment: |-
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
unmarkComment: >-
This issue is no longer marked for closure.
closeComment: >-
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

View file

@ -1,72 +0,0 @@
---
name: CI
'on':
pull_request:
push:
branches:
- master
schedule:
- cron: "30 2 * * 3"
defaults:
run:
working-directory: 'geerlingguy.munin-node'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
with:
path: 'geerlingguy.munin-node'
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install yamllint ansible ansible-lint
- name: Lint code.
run: |
yamllint .
ansible-lint
molecule:
name: Molecule
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: centos7
playbook: converge.yml
- distro: ubuntu1804
playbook: converge.yml
- distro: centos7
playbook: playbook-vars.yml
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
with:
path: 'geerlingguy.munin-node'
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install ansible molecule[docker] docker
- name: Run Molecule tests.
run: molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}

View file

@ -1,38 +0,0 @@
---
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
# repository or organization.
#
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
# See: https://github.com/ansible/galaxy/issues/46
name: Release
'on':
push:
tags:
- '*'
defaults:
run:
working-directory: 'geerlingguy.munin-node'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
with:
path: 'geerlingguy.munin-node'
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install Ansible.
run: pip3 install ansible-base
- name: Trigger a new import on Galaxy.
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)

View file

@ -1,5 +0,0 @@
*.retry
*/__pycache__
*.pyc
.cache

View file

@ -1,11 +0,0 @@
---
extends: default
rules:
line-length:
max: 120
level: warning
ignore: |
.github/stale.yml
.travis.yml

View file

@ -1,20 +0,0 @@
The MIT License (MIT)
Copyright (c) 2017 Jeff Geerling
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -38,3 +38,10 @@ munin_node_config: {
# "env.name": "bash"
# }
}
munin_node_remove_plugins:
- name: meminfo
munin_node_log: /var/log/munin/munin-node.log
munin_node_pid: /var/run/munin/munin-node.pid

View file

@ -1,3 +1,5 @@
---
- name: restart munin-node
service: name=munin-node state=restarted
service:
name: munin-node
state: restarted

View file

@ -1,27 +1,3 @@
---
dependencies: []
galaxy_info:
# See: https://github.com/ansible/galaxy/issues/2393
# role_name: munin-node
author: geerlingguy
description: Munin node monitoring endpoint for RedHat/CentOS or Debian/Ubuntu.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.4
platforms:
- name: Debian
versions:
- all
- name: Ubuntu
versions:
- all
- name: EL
versions:
- 7
- 8
galaxy_tags:
- monitoring
- system
- munin
- metrics
dependencies:
- role: mgrote.apt_install_packages

View file

@ -1,21 +0,0 @@
---
- name: Converge
hosts: all
become: true
pre_tasks:
- name: Update apt cache.
apt: update_cache=true
when: ansible_os_family == 'Debian'
changed_when: false
- name: Install test dependencies (Debian).
package: name=netcat state=present
when: ansible_os_family == 'Debian'
- name: Install test dependencies (RedHat).
package: name=nc state=present
when: ansible_os_family == 'RedHat'
roles:
- role: geerlingguy.munin-node

View file

@ -1,17 +0,0 @@
---
dependency:
name: galaxy
driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
playbooks:
converge: ${MOLECULE_PLAYBOOK:-converge.yml}

View file

@ -1,36 +0,0 @@
---
- name: Converge
hosts: all
become: true
vars:
munin_node_allowed_cidrs: ['10.0.0.0/8', '2001:db8::/32']
munin_node_denied_cidrs: ['10.42.0.0/16', '2001:db8:42::/48']
munin_node_plugins:
- name: uptime
- name: if_eth1
plugin: if_
munin_node_config: {
"ps_test": {
"env.regex": "bash",
"env.name": "bash"
}
}
pre_tasks:
- name: Update apt cache.
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
changed_when: false
- name: Install test dependencies (Debian).
package: name=netcat state=present
when: ansible_os_family == 'Debian'
- name: Install test dependencies (RedHat).
package: name=nc state=present
when: ansible_os_family == 'RedHat'
roles:
- role: geerlingguy.munin-node

View file

@ -1,58 +1,63 @@
---
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Ensure munin-node is installed (Debian).
apt:
name: munin-node
state: present
when: ansible_os_family == 'Debian'
- name: Ensure munin-node is installed (RedHat).
yum: name=munin-node state=present enablerepo=epel
when: ansible_os_family == 'RedHat'
- name: Copy munin-node configuration.
template:
src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf
owner: root
group: root
mode: 0644
notify: restart munin-node
- name: Ensure munin-node is installed (Debian).
apt: name=munin-node state=present
when: ansible_os_family == 'Debian'
- name: Generate plugin configuration.
template:
src: plugin-conf.j2
dest: /etc/munin/plugin-conf.d/ansible.conf
owner: root
group: root
mode: 0644
notify: restart munin-node
- name: Copy munin-node configuration.
template:
src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf
owner: root
group: root
mode: 0644
notify: restart munin-node
- name: Install extra plugins.
copy:
src: "{{ item.src }}"
dest: "{{ munin_plugin_src_path }}{{ item.src | basename }}"
mode: '0755'
with_items: "{{ munin_node_install_plugins }}"
when: item.src is defined
notify: restart munin-node
- name: Generate plugin configuration.
template:
src: plugin-conf.j2
dest: /etc/munin/plugin-conf.d/ansible.conf
owner: root
group: root
mode: 0644
notify: restart munin-node
- name: Install extra remote plugins.
get_url:
url: "{{ item.remote_src }}"
dest: "{{ munin_plugin_src_path }}{{ item.remote_src | basename }}"
mode: '0755'
with_items: "{{ munin_node_install_plugins }}"
when: item.remote_src is defined
notify: restart munin-node
- name: Install extra plugins.
copy:
src: "{{ item.src }}"
dest: "{{ munin_plugin_src_path }}{{ item.src | basename }}"
mode: '0755'
with_items: "{{ munin_node_install_plugins }}"
when: item.src is defined
notify: restart munin-node
- name: Enable additional plugins.
file: # noqa 208
path: "{{ munin_plugin_dest_path }}{{ item.name }}"
src: "{{ munin_plugin_src_path }}{{ item.plugin | default( item.name ) }}"
state: link
with_items: "{{ munin_node_plugins }}"
notify: restart munin-node
- name: Install extra remote plugins.
get_url:
url: "{{ item.remote_src }}"
dest: "{{ munin_plugin_src_path }}{{ item.remote_src | basename }}"
mode: '0755'
with_items: "{{ munin_node_install_plugins }}"
when: item.remote_src is defined
notify: restart munin-node
- name: remove unwanted plugins
file: # noqa 208
path: "{{ munin_plugin_dest_path }}{{ item.name }}"
state: absent
with_items: "{{ munin_node_remove_plugins }}"
notify: restart munin-node
- name: Enable additional plugins.
file: # noqa 208
path: "{{ munin_plugin_dest_path }}{{ item.name }}"
src: "{{ munin_plugin_src_path }}{{ item.plugin | default( item.name ) }}"
state: link
with_items: "{{ munin_node_plugins }}"
notify: restart munin-node
- name: Ensure munin-node is running.
service: name=munin-node state=started enabled=yes
- name: Ensure munin-node is running.
service:
name: munin-node
state: started
enabled: yes

View file

@ -1,3 +0,0 @@
---
munin_node_log: /var/log/munin/munin-node.log
munin_node_pid: /var/run/munin/munin-node.pid

View file

@ -1,3 +0,0 @@
---
munin_node_log: /var/log/munin-node/munin-node.log
munin_node_pid: /var/run/munin/munin-node.pid