I want to detect broken RAIDS in Windows and I think I'm close with a very simple recipe, but somehow I just can't see it working reliably on ALL windows machines.
Userparameters
Output of vfs.volumes
In this case the output of the 4 userparameters are
But somehow the 2 userparameters are greyed out in "latest data" with the information "0"
Why?
I don't know....
I created 2 triggers
This one for the RAID volumes
This one for the regular volumes
I thought I could let the Zabbix server process the output of diskpart itself, but I found out I have no means of counting the strings.
regexp() can only return 0 or 1 (for instance)
I also can't think of some regular expression to use as preprocessing a dependent item that would count the occurences of the RAID.
Another solution would be the creation of a script that gives an output like this. Then I could use the available regular expressions to create dependent items.
I'm just not that good with powershell (quite good in bash, though).
Anyone willing to help me???
Userparameters
Code:
UserParameter=vfs.softraid.count, findstr /i "Mirror RAID" %TEMP%\diskpart | find /c /i "volume" UserParameter=vfs.softraid.healthy, findstr /i "Mirror RAID" %TEMP%\diskpart | findstr /i "healthy orde" | find /c /i "volume" UserParameter=vfs.volumes.count, findstr /i /v "Mirror RAID" %TEMP%\diskpart | find /c /i "volume" UserParameter=vfs.volumes.healthy, findstr /i /v "Mirror RAID" %TEMP%\diskpart | findstr /i "healthy orde" | find /c /i "volume" UserParameter=vfs.volumes, echo.list volume | diskpart | findstr /i "FAT NTFS" >%TEMP%\diskpart && TYPE %TEMP%\diskpart
Code:
Volume 0 C Windows NTFS Partition 27 GB Healthy Boot Volume 1 SYSTEM FAT32 Partition 100 MB Healthy System Volume 2 Recovery NTFS Partition 1024 MB Healthy Hidden
Code:
vfs.softraid.count 0 vfs.softraid.healthy 0 vfs.volumes.count 3 vfs.volumes.healthy 3
Why?
I don't know....
I created 2 triggers
This one for the RAID volumes
Code:
{Template_Windows_Volumes:vfs.softraid.healthy.last()}
< {Template_Windows_Volumes:vfs.softraid.count.last()}
Code:
{Template_Windows_Volumes:vfs.volumes.healthy.last()}
< {Template_Windows_Volumes:vfs.volumes.count.last()}
I thought I could let the Zabbix server process the output of diskpart itself, but I found out I have no means of counting the strings.
regexp() can only return 0 or 1 (for instance)
I also can't think of some regular expression to use as preprocessing a dependent item that would count the occurences of the RAID.
Another solution would be the creation of a script that gives an output like this. Then I could use the available regular expressions to create dependent items.
Code:
All SoftRaid Volumes 0 Healthy Softraid Volumes 0 Regular Volumes 3 Healthy Regular Volumes 3
Anyone willing to help me???
Comment