You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Mon Sep 28 21:34:49 2020
Raid Level : raid0
Array Size : 7813520384 (7451.55 GiB 8001.04 GB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Mon Sep 28 21:34:49 2020
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : original
Chunk Size : 512K
Consistency Policy : none
Name : ubuntu-server:0
UUID : b14fa1a1:96da7eba:8fd8a81c:36258895
Events : 0
Number Major Minor RaidDevice State
0 8 34 0 active sync /dev/sdc2
1 8 17 1 active sync /dev/sdb1
2 8 1 2 active sync /dev/sda1
3 8 49 3 active sync /dev/sdd1
I copied your userparameter_md.conf file into /etc/zabbix/zabbix_agentd.d folder . For the servers that have configured raid1 - this parameter works well: UserParameter=custom.md.discovery,cat /proc/mdstat | grep -B 1 -E "(U+|_+)" | awk 'BEGIN { printf "{\"data\":["}; /^md/ { printf c"{\"{#MDNAME}\":\""$1"\"}";c=","}; END{ print "]}" }'
But I have raid0 and this grep cat /proc/mdstat | grep -B 1 -E "(U+|_+)" not parsed it. It returned NULL, because it parse UU that is not used for raid0.
And if you try to use this user parameter: UserParameter=custom.md.discovery,cat /proc/mdstat | awk 'BEGIN { printf "{\"data\":["}; /^md/ { printf c"{\"{#MDNAME}\":\""$1"\"}";c=","}; END{ print "]}" }' - zabbix will parse raid0 devices.
The text was updated successfully, but these errors were encountered:
So I have ubuntu 20.04 with raid0
I copied your userparameter_md.conf file into
/etc/zabbix/zabbix_agentd.d
folder . For the servers that have configured raid1 - this parameter works well:UserParameter=custom.md.discovery,cat /proc/mdstat | grep -B 1 -E "(U+|_+)" | awk 'BEGIN { printf "{\"data\":["}; /^md/ { printf c"{\"{#MDNAME}\":\""$1"\"}";c=","}; END{ print "]}" }'
But I have raid0 and this grep
cat /proc/mdstat | grep -B 1 -E "(U+|_+)"
not parsed it. It returned NULL, because it parse UU that is not used for raid0.And if you try to use this user parameter:
UserParameter=custom.md.discovery,cat /proc/mdstat | awk 'BEGIN { printf "{\"data\":["}; /^md/ { printf c"{\"{#MDNAME}\":\""$1"\"}";c=","}; END{ print "]}" }'
- zabbix will parse raid0 devices.The text was updated successfully, but these errors were encountered: