To monitor software RAID in Zabbix 1.8 you need to make following changes in Zabbix:
in /etc/zabbix/zabbix-agent*.conf on client
add in the end of the file:
#CONTROLLO RAID
UserParameter=custom.mdstat,/bin/cat /proc/mdstat | grep -c _
You need to restart zabbix Agent
sudo service zabbix-agent restart
On the Zabbix server add to the Linux Template:
Items:
Host: Template_Linux
Description: MDStat
Type: Zabbix_agent
Key: custom.mdstat
Applications: Availability, FilesystemTrigger:
Name: RAID on {HOSTNAME}
Expression: {Template_Linux:custom.mdstat.last(0)}>0
This is tested on Ubuntu servers with:
RAID 1 with 2 disks
RAID 5 with 4 and 6 disks
RAID 6 with 8 disks
Thanks for some quality points there. I am kind of new to online , so I printed this off to put in my file, any better way to go about keeping track of it then printing?
Comment by incorporation — 2011/01/22 @ 05:46
Thanks for the detail.
Just one correction however, your trigger will only trigger when there is more than one partition missing from the RAID set so if one partition is missing it would still be “OK”
{Template_Linux:custom.mdstat.last(0)}>1
This should be {Template_Linux:custom.mdstat.last(0)}>0 which means it would trigger when one or more partition is missing from the RAID set.
While I am commenting ๐ – on newer versions of Zabbix the exact config is a bit different.
The trigger part in particular would need to be the following:
Trigger:
Name: RAID on {HOST.NAME}
Expression: {Template OS Linux:custom.mdstat.last(0)}>0
Comment by Eugene — 2015/08/07 @ 08:33
Thanks for you comment!
I had change this in my running config but not here. (I double checked ๐ )
(Post updated)
Comment by Mathz — 2015/08/07 @ 08:43
you dont need to add a UserParameter, it is possible to use the vfs.file.regmatch agent function.
https://www.zabbix.com/forum/showpost.php?p=91083&postcount=18
Comment by Bernd Kammlott — 2016/06/07 @ 10:45
Thanks for make my life easyer!
Comment by Mathz — 2016/10/30 @ 08:45