Skip to content

Commit

Permalink
applied MD RAID fixes from 6.0 to 5.0 and 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
GIJack committed Apr 10, 2022
1 parent 2802d82 commit 05cac8c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export><version>5.0</version><date>2021-11-25T12:36:13Z</date><groups><group><name>Templates</name></group></groups><templates><template><template>MD Soft RAID</template><name>MD Soft RAID</name><groups><group><name>Templates</name></group></groups><applications><application><name>MD</name></application></applications><discovery_rules><discovery_rule><name>MD Discovery</name><key>md.discover</key><delay>3600</delay><item_prototypes><item_prototype><name>MD $1 degraded</name><key>md.degraded[{#MDNAME}]</key><delay>5m</delay><history>3600</history><trends>86400</trends><description>Get number of degraded disks</description><applications><application><name>MD</name></application></applications><trigger_prototypes><trigger_prototype><expression>{last()}&gt;0</expression><name>MD {#MDNAME} is degraded on {HOST.NAME}</name><priority>HIGH</priority></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><name>MD $1 raid disks</name><key>md.raid_disks[{#MDNAME}]</key><delay>3600</delay><history>3600</history><trends>86400</trends><description>Get number of all disks</description><applications><application><name>MD</name></application></applications><trigger_prototypes><trigger_prototype><expression>{diff()}&gt;0</expression><name>MD {#MDNAME} number of disks changed on {HOST.NAME}</name><priority>WARNING</priority></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><name>MD $1 sync action</name><key>md.sync_action[{#MDNAME}]</key><delay>300</delay><history>3600</history><trends>0</trends><value_type>TEXT</value_type><description>Get current sync action</description><applications><application><name>MD</name></application></applications><trigger_prototypes><trigger_prototype><expression>{str(recover)}=1</expression><name>MD {#MDNAME} in recovery mode on {HOST.NAME}</name><priority>INFO</priority></trigger_prototype></trigger_prototypes></item_prototype></item_prototypes><graph_prototypes><graph_prototype><name>MD {#MDNAME} degration</name><graph_items><graph_item><color>1A7C11</color><item><host>MD Soft RAID</host><key>md.degraded[{#MDNAME}]</key></item></graph_item></graph_items></graph_prototype></graph_prototypes></discovery_rule></discovery_rules></template></templates></zabbix_export>
<zabbix_export><version>5.0</version><date>2021-11-25T12:36:13Z</date><groups><group><name>Templates</name></group></groups><templates><template><template>MD Soft RAID</template><name>MD Soft RAID</name><groups><group><name>Templates</name></group></groups><applications><application><name>MD</name></application></applications><discovery_rules><discovery_rule><name>MD Discovery</name><key>md.discover</key><delay>3600</delay><item_prototypes><item_prototype><name>MD {#MDNAME} degraded</name><key>md.degraded[{#MDNAME}]</key><delay>5m</delay><history>3600</history><trends>86400</trends><description>Get number of degraded disks</description><applications><application><name>MD</name></application></applications><trigger_prototypes><trigger_prototype><expression>{last()}&gt;0</expression><name>MD {#MDNAME} is degraded on {HOST.NAME}</name><priority>HIGH</priority></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><name>MD {#MDNAME} raid disks</name><key>md.raid_disks[{#MDNAME}]</key><delay>3600</delay><history>3600</history><trends>86400</trends><description>Get number of all disks</description><applications><application><name>MD</name></application></applications><trigger_prototypes><trigger_prototype><expression>{diff()}&gt;0</expression><name>MD {#MDNAME} number of disks changed on {HOST.NAME}</name><priority>WARNING</priority></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><name>MD {#MDNAME} sync action</name><key>md.sync_action[{#MDNAME}]</key><delay>300</delay><history>3600</history><trends>0</trends><value_type>TEXT</value_type><description>Get current sync action</description><applications><application><name>MD</name></application></applications><trigger_prototypes><trigger_prototype><expression>{str(recover)}=1</expression><name>MD {#MDNAME} in recovery mode on {HOST.NAME}</name><priority>INFO</priority></trigger_prototype></trigger_prototypes></item_prototype></item_prototypes><graph_prototypes><graph_prototype><name>MD {#MDNAME} degration</name><graph_items><graph_item><color>1A7C11</color><item><host>MD Soft RAID</host><key>md.degraded[{#MDNAME}]</key></item></graph_item></graph_items></graph_prototype></graph_prototypes></discovery_rule></discovery_rules></template></templates></zabbix_export>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
UserParameter=md.discover,ls /sys/class/block | awk 'BEGIN{printf "{\"data\":["}; /^md[0-9]+$/ {printf c"{\"{#MDNAME}\":\""$1"\"}";c=","}; END{print "]}"}'
UserParameter=md.degraded[*],cat /sys/block/$1/md/degraded
UserParameter=md.sync_action[*],cat /sys/block/$1/md/sync_action
UserParameter=md.raid_disks[*],cat /sys/block/$1/md/raid_disks

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ zabbix_export:
item_prototypes:
-
uuid: 61bdf950e6c9471c919a9f549b02fa20
name: 'MD $1 degraded'
name: 'MD {#MDNAME} degraded'
key: 'md.degraded[{#MDNAME}]'
delay: 5m
history: '3600'
Expand All @@ -40,7 +40,7 @@ zabbix_export:
priority: HIGH
-
uuid: 34537ac721304c0ea4192777528fba95
name: 'MD $1 raid disks'
name: 'MD {#MDNAME} raid disks'
key: 'md.raid_disks[{#MDNAME}]'
delay: '3600'
history: '3600'
Expand All @@ -58,7 +58,7 @@ zabbix_export:
priority: WARNING
-
uuid: b34710292d384172a02c977d76d00c63
name: 'MD $1 sync action'
name: 'MD {#MDNAME} sync action'
key: 'md.sync_action[{#MDNAME}]'
delay: '300'
history: '3600'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
UserParameter=md.discover,ls /sys/class/block | awk 'BEGIN{printf "{\"data\":["}; /^md[0-9]+$/ {printf c"{\"{#MDNAME}\":\""$1"\"}";c=","}; END{print "]}"}'
UserParameter=md.degraded[*],cat /sys/block/$1/md/degraded
UserParameter=md.sync_action[*],cat /sys/block/$1/md/sync_action
UserParameter=md.raid_disks[*],cat /sys/block/$1/md/raid_disks

0 comments on commit 05cac8c

Please sign in to comment.