Ad Widget

Collapse

SMART by Zabbix agent 2 does not detect SAS disks behind RAID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Flabbergastix
    Junior Member
    • Feb 2025
    • 4

    #1

    SMART by Zabbix agent 2 does not detect SAS disks behind RAID

    Hi Zabbix,

    I've got a HPE DL380 Gen10 with two RAIDs on it, #lsblk returns my two RAIDs, mounted under /dev/sda and /dev/sdb.
    smartctl is installed and running, Zabbix agent has admin rights for it (sudo visudo > zabbix ALL=(ALL) NOPASSWD:/usr/sbin/smartctl).

    Now to my question: "SMART by Zabbix agent 2" only discovers /dev/sdc (which is the SSD of the server-OS). How can I get this template to also list the disks behind my two RAIDs?
    I've verified the Zabbix agent metrics on the server itself, utilizing #zabbix_agent2 -t smart.disk.discovery, but it's also only showing /dev/sdc​.

    I can manually retrieve the SMART status via #​smartctl -a -l ssd /dev/sda -d cciss,0 (.. which would return the disk status in slot0 behind /dev/sda​).

    Thanks in advance for your time!



  • Flabbergastix
    Junior Member
    • Feb 2025
    • 4

    #2
    Maybe, as a follow up question - is it possible to post a value against Zabbix? An API?

    Comment

    • PavelZ
      Senior Member
      • Dec 2024
      • 162

      #3
      The polling in zabbix agent2 is quite confusing. Sometimes it's just impossible to make it use the right parameters.
      How about making a wrapper script?

      Examples in this repository - https://github.com/pavlozt/somezabbi...martctlwrapper
      There is no solution to your specific problem there. A similar one is solved there.

      Comment

      • Flabbergastix
        Junior Member
        • Feb 2025
        • 4

        #4
        Hi sir,

        many thanks for your reply - will have a look. But, I'd prefer to use the API - found this from the official docs and furthermore zabbix_utils.

        Comment

        • PavelZ
          Senior Member
          • Dec 2024
          • 162

          #5
          It seems very strange to me that they are trying to build a script with API instead of fixing the collection.
          Before Zabbix Agent 2, other solutions were popular. Here is another old template, but it sill works - https://github.com/v-zhuravlev/zbx-smartctl
          there are completely separate scripts there

          Comment

          • Flabbergastix
            Junior Member
            • Feb 2025
            • 4

            #6
            Hi,

            came up with another (working) approach;
            1. in zabbix, I edited the default "Linux by Zabbix agent" template and added 8 additional items "trapper.smart_status_disk1-8" as type = "Zabbix trapper"
            2. on the server, I've set up a bash-script with the above mentioned command (/usr/sbin/smartctl -a -l ssd /dev/sda -d cciss,$temp_slot | grep -E "SMART Health Status") - it's important to call the full path to smartctl if you don't use env variables!
            3. next, I installed zabbix-sender to send the values to my zabbix server
            4. in the bash-script, added the following: zabbix_sender -z $zabbix_server -p $zabbix_port -s $global_hostname -k $zabbix_item -o "$smart_status"
            5. added a cronjob that's executed hourly
            6. from there on, you have the status ("SMART Health Status: OK") in zabbix, feel free to perform any manipulation (like replace, ...) and add triggers -> in my case, I'm converting to numbers to work with thresholds, etc.
            KR
            Last edited by Flabbergastix; 14-03-2025, 08:31.

            Comment

            Working...