Skip to content

Commit ce7d995

Browse files
committed
Do a more complete job of removing stale plugins
After testing prior commit, found a few more things that are common between container and host, etc, plus fixed a few bugs
1 parent a5b917b commit ce7d995

File tree

4 files changed

+61
-31
lines changed

4 files changed

+61
-31
lines changed

roles/monitoring/tasks/main.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,23 @@
125125
- name: find possibly extraneous munin checks (hwmon wildcard)
126126
find:
127127
paths: /etc/munin/plugins
128+
file_type: any
128129
patterns:
129130
- sensors_*
130-
file_type: link
131131
register: munin_plugins_to_possibly_delete_hwmon
132132

133133
- name: find disk devices
134134
find:
135135
paths: /dev
136+
file_type: any
136137
patterns: [ sda, sdb, sdc, sdd, sde, sdf, sdg, sdh, sdi, sdj, sdk, sdl, sdm, sdn, sdo, sdp, nvme0n1, nvme0n2 ]
137138
register: disk_devices
138139

139140
- name: find extraneous munin checks (ntp wildcards and list)
140141
find:
141142
paths: /etc/munin/plugins
143+
file_type: any
142144
patterns: "{{ remove_munin_plugins }}"
143-
file_type: link
144145
register: munin_plugins_to_delete
145146

146147
- name: remove extraneous munin checks (ntp wildcards and list)
@@ -160,22 +161,22 @@
160161
notify: restart munin-node
161162
when: not hwmon0.stat.exists
162163

163-
- name: remove extraneous munin plugins (virtual machines, containers)
164+
- name: remove extraneous munin plugins without params (pi or non virtual nor container; ie, physical machines including pi)
164165
file:
165166
path: "/etc/munin/plugins/{{ item }}"
166167
state: absent
167168
become: true
168-
with_items: "{{ physical_machine_munin_plugins }}"
169-
when: host_is_container | default(false) or host_is_virtual | default(false) or host_is_pi | default(false)
169+
with_items: "{{ pi_or_non_virtual_nor_container_munin_plugins }}"
170+
when: not (host_is_pi | default(false) or not ( host_is_container | default(false) or host_is_virtual | default(false) ) )
170171
notify: restart munin-node
171172

172-
- name: remove monitoring plugins not used in containers
173+
- name: remove extraneous munin plugins without params (non virtual nor container nor pi; ie, physical machines but not including pi)
173174
file:
174175
path: "/etc/munin/plugins/{{ item }}"
175176
state: absent
176177
become: true
177-
with_items: "{{ non_container_custom_munin_plugins_with_args }}"
178-
when: host_is_container | default(false)
178+
with_items: "{{ non_virtual_nor_container_nor_pi_munin_plugins }}"
179+
when: host_is_container | default(false) or host_is_virtual | default(false) or host_is_pi | default(false)
179180
notify: restart munin-node
180181

181182
- name: remove monitoring plugins not used in containers with params
@@ -223,9 +224,9 @@
223224
when: host_is_container | default(false)
224225
notify: restart munin-node
225226

226-
- name: remove existing munin plugins without params
227+
- name: remove existing munin plugins without params (non containers)
227228
file:
228-
path: "/etc/munin/plugins/{{ item.src }}"
229+
path: "/etc/munin/plugins/{{ item }}"
229230
state: absent
230231
become: true
231232
with_items: "{{ non_container_munin_plugins }}"
@@ -337,7 +338,7 @@
337338
with_items: "{{ munin_plugins }}"
338339
notify: restart munin-node
339340

340-
- name: existing munin plugins without params (non containers)
341+
- name: install existing munin plugins without params (non containers)
341342
file:
342343
src: "/usr/share/munin/plugins/{{ item }}"
343344
dest: "/etc/munin/plugins/{{ item }}"
@@ -347,13 +348,23 @@
347348
when: not (host_is_container | default(false))
348349
notify: restart munin-node
349350

350-
- name: existing munin plugins without params (physical machines)
351+
- name: enable existing munin plugins without params (pi or non virtual nor container; ie, physical machines including pi)
352+
file:
353+
src: "/usr/share/munin/plugins/{{ item }}"
354+
dest: "/etc/munin/plugins/{{ item }}"
355+
state: link
356+
become: true
357+
with_items: "{{ pi_or_non_virtual_nor_container_munin_plugins }}"
358+
when: host_is_pi | default(false) or not ( host_is_container | default(false) or host_is_virtual | default(false) )
359+
notify: restart munin-node
360+
361+
- name: enable existing munin plugins without params (non virtual nor container nor pi; ie, physical machines but not including pi)
351362
file:
352363
src: "/usr/share/munin/plugins/{{ item }}"
353364
dest: "/etc/munin/plugins/{{ item }}"
354365
state: link
355366
become: true
356-
with_items: "{{ physical_machine_munin_plugins }}"
367+
with_items: "{{ non_virtual_nor_container_nor_pi_munin_plugins }}"
357368
when: not ( host_is_container | default(false) or host_is_virtual | default(false) or host_is_pi | default(false) )
358369
notify: restart munin-node
359370

roles/monitoring/vars/main.yml

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@
1111
- squid_objectsize
1212
- squid_cache
1313
- squid_traffic
14-
- "{{ (host_is_zfs | default(false) ) | ternary( omit, 'zfs*_*') }}"
15-
- "{{ (host_is_container | default(false) ) | ternary( 'numa_*', omit ) }}"
16-
- "{{ (host_is_container | default(false) ) | ternary( 'smart_*', omit ) }}"
17-
- "{{ (host_is_container | default(false) ) | ternary( 'sensors_*', omit ) }}"
18-
- "{{ (host_is_container | default(false) ) | ternary( 'nutups_*', omit ) }}"
19-
- "{{ (host_is_dell | default(false) ) | ternary( omit, 'ipmi_' ) }}"
14+
- ping_gamow
15+
- ping_maxwell
16+
- "{{ (host_is_zfs | default(false) ) | ternary( omit, 'zfs*_*') }}"
17+
- "{{ (host_is_container | default(false) ) | ternary( 'numa_*', omit ) }}"
18+
- "{{ (host_is_container | default(false) ) | ternary( 'chrony_*', omit ) }}"
19+
- "{{ (host_is_container | default(false) ) | ternary( 'nvme_*', omit ) }}"
20+
- "{{ (host_is_container | default(false) ) | ternary( 'smart_*', omit ) }}"
21+
- "{{ (host_is_container | default(false) ) | ternary( 'sensors_*', omit ) }}"
22+
- "{{ (host_is_container | default(false) ) | ternary( 'nutups_*', omit ) }}"
23+
- "{{ (host_is_dell | default(false) ) | ternary( omit, 'ipmi_' ) }}"
24+
- "{{ (host_is_pve_server | default(false) ) | ternary( omit, 'raid' ) }}"
2025

21-
# would love to just put our modified plugins that
26+
# From munin git repos and copied across to the machine.
27+
# Would love to just put our modified plugins that
2228
# are already in upstream, directly into
2329
# /etc/munin/plugins, but these are the ones that
2430
# take arguments, so they need to go somewhere!
@@ -30,7 +36,11 @@
3036
- nvme_
3137
- tasmota_
3238

33-
physical_machine_munin_plugins:
39+
pi_or_non_virtual_nor_container_munin_plugins:
40+
- cpuspeed
41+
42+
non_virtual_nor_container_nor_pi_munin_plugins:
43+
- acpi
3444
- hddtemp_smartctl
3545

3646
dell_ipmi_munin_plugins:
@@ -39,6 +49,7 @@
3949
- ipmi_fans
4050
- ipmi_volts
4151

52+
# From munin git repos and copied across to the machine:
4253
zfs_custom_munin_plugins:
4354
- zfs-demand
4455
- zfs-general
@@ -57,7 +68,7 @@
5768
- zpool_capacity
5869
- zpool_iostat
5970

60-
# we don't run suggests on zfsonlinux every time
71+
# We don't run suggests on zfsonlinux every time
6172
zfs_munin_plugins_with_args:
6273
- { src: 'zfsonlinux_stats_efficiency', dest: 'zfsonlinux_stats_' }
6374
- { src: 'zfsonlinux_stats_cachehitlist', dest: 'zfsonlinux_stats_' }
@@ -67,18 +78,24 @@
6778
- { src: 'zfsonlinux_stats_l2utilization', dest: 'zfsonlinux_stats_' }
6879
- { src: 'zfsonlinux_stats_l2efficiency', dest: 'zfsonlinux_stats_' }
6980

81+
# From munin git repos and copied across to the machine:
7082
non_container_custom_munin_plugins:
71-
- chrony_sourcestats
83+
- cpuidle # actually the stats of the host (although of course you might care to correlate performance problems against host resources)
84+
- chrony_sourcestats # clock is locked to host
7285
- chrony_status
7386
- chrony
7487
- chrony_drift
7588
- ntp_thirdparty
76-
- raid
7789

78-
non_container_munin_plugins: []
79-
#FIXME: dunno here or all hosts: - iostat
80-
#FIXME: dunno here or all hosts: - iostat_ios
81-
#FIXME: dunno here or all hosts: - netstat
90+
non_container_munin_plugins:
91+
- diskstats
92+
- interrupts
93+
- irqstats
94+
- load # host
95+
- processes # host
96+
- swap # seems to be measuring host values
97+
- iostat
98+
- iostat_ios
8299

83100
non_container_munin_plugins_with_args:
84101
- { src: 'ping_dirac', dest: 'ping_' }
@@ -96,15 +113,15 @@
96113
- nutups_
97114
# - ipmi_ # wants to set all 4 on all hosts, so define them via a check on host_is_dell_server instead
98115

116+
# From munin git repos and copied across to the machine:
99117
custom_munin_plugins:
100-
- cpuidle
101118
- fail2ban
102119
- fail2ban_all_jails
103120

104121
munin_plugins:
105122
- df_abs
106-
- iostat
107-
- iostat_ios
123+
- df
124+
- df_inode
108125
- netstat
109126

110127
munin_suggests:

roles/pve_server/files/munin/raid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../repos/munin-contrib/plugins/disk/raid

roles/pve_server/tasks/after_bootstrap.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
- ceph_capacity
220220
# - ceph-osd-info # lot of graphs and questionable value, even when overriding ceph-osd-info internally by specifying subgraphs=False
221221
- proxmox_vm_count
222+
- raid
222223
notify: restart munin-node
223224

224225
- name: install some extra ceph monitoring plugins

0 commit comments

Comments
 (0)