addad raid check for mdadm raid arrays

This commit is contained in:
olli 2022-09-27 15:27:44 +02:00
parent 0cc555afd9
commit 78b8131e18

View File

@ -118,6 +118,28 @@
notify:
- Restart runchecks
- name: /usr/local/sbin/runchecks.d/raid-mdadm.check
blockinfile:
path: /usr/local/sbin/runchecks.d/raid-mdadm.check
mode: "0400"
owner: root
group: root
create: yes
marker: "# {mark} ANSIBLE MANAGED BLOCK"
blocck: |
mdadm -D --scan | egrep "^ARRAY" | cut -d" " -f2 | while read array
do
mdadm -D $array >$g_tmp/raiddetails
if ! cat $g_tmp/raiddetails | egrep "^ +State : " | egrep -q "^ +State : clean$"
then
g_echo_error "RAID $array state not clean - mdadm -D $array: $(cat $g_tmp/raiddetails)"
fi
done
validate: /bin/bash -n %s
backup: yes
notify:
- Restart runchecks
- name: /usr/local/sbin/runchecks.d/internet.check
blockinfile:
path: /usr/local/sbin/runchecks.d/internet.check