Ad Widget

Collapse

Trigger When Disk Goes Offline LINUX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • datacare
    Junior Member
    • Dec 2021
    • 22

    #1

    Trigger When Disk Goes Offline LINUX

    I am using Zabbix 7.0.4 and on my Linux Servers I am using Linux by Zabbix agent active 7.0 template. I am looking for a way to receive an alert if a disk goes offline. So in example if I was to slide the hot swap tray out on disk "sdb", I could receive an alert that he disk has gone offline or failed. The template seems to collect all kinds of data about the disk, but does not collect or alert on anything having to do with the disk being present or working that I might build a trigger of of.

    I also tried Template MD RAID​ and was completely unable to get it to even collect any data from that template.
  • datacare
    Junior Member
    • Dec 2021
    • 22

    #2
    This is how I got this to work.

    Created item example:
    Item Name: Drive Online SDA
    item key: vfs.file.exists[/dev/sda,dev,]

    Trigger Name; Drive OFFLINE SDA
    eXPRESSION: last(/X-TEST-1/vfs.file.exists[/dev/sda,dev,])=0

    This monitors if the drive SDA is online by checking if file /dev/sda is present. If the drive is disconnected or fails and the file /dev/sda is removed by the system because the drive no longer is connected or functions it fires the trigger.

    I hope htis helps someone else who is having this same need to monitor a drive in Linux

    Comment

    Working...