Ad Widget

Collapse

Discussion thread for official Zabbix SMART Disk monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • dv8472
    replied
    Originally posted by dv8472
    I made there a minor mistake, it's supposed to be w/o the template macros, hence:


    Leave a comment:


  • dv8472
    replied
    I made there a minor mistake, it's supposed to be w/o the template macros, hence:

    Originally posted by dv8472
    Hello,
    how about to extend the default temperature (or perhaps even other) triggers with the User macros with context?
    Could be useful in case, when one has various disks with different thresholds

    The triggers would be then like:
    avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT:"{#NAME}"}
    avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.WARN:"{#NAME}"}

    I wanted first to check with the people here, whether something like that makes some sense in your eyes.
    If yes, I'll open a ticket for this.

    Leave a comment:


  • dv8472
    replied
    Hello,
    how about to extend the default temperature (or perhaps even other) triggers with the User macros with context?
    Could be useful in case, when one has various disks with different thresholds

    Template macros would be like:
    {$SMART.TEMPERATURE.MAX.CRIT:"{#NAME}"}
    {$SMART.TEMPERATURE.MAX.WARN:"{#NAME}"}

    The triggers would be then like:
    avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT:"{#NAME}"}
    avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.WARN:"{#NAME}"}

    I wanted first to check with the people here, whether something like that makes some sense in your eyes.
    If yes, I'll open a ticket for this.

    Leave a comment:


  • VAXman65
    replied
    Originally posted by Markku

    Is this because of the same issue as described in https://support.zabbix.com/browse/ZBX-26359 (Zabbix agent2 smart.disk.discovery fails due to strict exit status check on smartctl, preventing parsing of valid SMART data)?
    It does appear to be a match.

    Leave a comment:


  • Markku
    replied
    Originally posted by VAXman65
    Solved my own issue. Basically, i needed to force the exit status from smartctl to 0
    Is this because of the same issue as described in https://support.zabbix.com/browse/ZBX-26359 (Zabbix agent2 smart.disk.discovery fails due to strict exit status check on smartctl, preventing parsing of valid SMART data)?

    Markku

    Leave a comment:


  • VAXman65
    replied
    Solved my own issue. Basically, i needed to force the exit status from smartctl to 0

    I had set up Plugins.Smart.Path=/usr/local/sbin/smartctl-zabbix in the configuration already. I did this originally to stop a slew of bogus error coming out for impossible scans (refer to the if block). The fix i needed to get the MegaRAID devices reporting is at the end of the code

    Code:
    #!/usr/bin/env bash
    
    #
    # case statement "eats" invocation of smartctl if -d for areca, 3ware, or cciss. Objective is to
    # cut down on errors for "smartctl is using a deprecated SCSI ioctl". Older code sections in
    # smartctl use the older ioctl and these are assoicated with these device types. One theory
    # is the fact that these devices are no present on the system triggers a branch referencing the
    # older ioctl.
    #
    # as of 7/10/2025, *3ware* calls seem OK
    #
    case "$@" in
    
    *areca*|*cciss* )
    /usr/bin/logger "smartctl-zabbix ate it"
    # echo "$@" >> /tmp/last-smartctl-zabbix-ate.txt
    echo "{}"
    ;;
    *) /usr/bin/logger "smartctl-zabbix OK"
    # echo "$@" >> /tmp/last-smartctl-zabbix.txt
    /usr/sbin/smartctl "$@"
    ;;
    esac
    
    #
    # Sometimes, smartctl returns perfectly good output, but with a non-zero exit code. Zabbix
    # agent sees this then treats all the output as bad. As a result, MegaRAID devices may be
    # enumerated, but no useful dartt is returned. Force return ststus to 0 to prevent this.
    # 20250713 pas
    #
    exit 0


    ​

    Leave a comment:


  • VAXman65
    replied
    I cannot get my Hardware RAID drives to show up.

    Zabbix Server. Zabbix 7.0.16 (revision e43512b75d0).

    Host being monitored is named wort:
    Plugin communication protocol version is 6.4.0
    Zabbix Agent2 hostname: [wort.lan.kitsnet.us]
    Starting Zabbix Agent 2 (7.0.16)
    smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.14.0-570.23.1.el9_6.x86_64] (local build)
    ​smartmontools release 7.2 dated 2020-12-30 at 16:48:30 UTC
    smartmontools SVN rev 5155 dated 2020-12-30 at 16:49:18
    smartmontools build host: x86_64-redhat-linux-gnu
    smartmontools build with: C++17, GCC 11.4.1 20231218 (Red Hat 11.4.1-3)
    ​
    Back when I was on Zabbix 5.4 infrastructure, this all worked great. Now, none of the RAID devices are shown. Odd thing is, Zabbix seems to eb doing the right queries and getting results. From journalctl -u zabbix-agent2 | grep smart

    Code:
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886712]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix --scan -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886720]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix --scan -d sat -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886733]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdc -d areca,1 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886729]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sda -d areca,1 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886737]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdb -d scsi -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886726]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdc -d scsi -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886740]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdc -d sat -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886728]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sda -d cciss,0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886738]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sda -d scsi -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886730]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/nvme0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886741]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdb -d cciss,0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886734]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdb -d sat -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886739]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdc -d 3ware,0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886732]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sda -d 3ware,0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886735]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdb -d areca,1 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886731]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdb -d 3ware,0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886736]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdc -d cciss,0 -j
    Jul 10 11:35:26 wort.lan.kitsnet.us sudo[886727]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sda -d sat -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886800]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d sat -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886813]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,20 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886802]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d scsi -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886806]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d sat -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886797]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d 3ware,0 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886808]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d scsi -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886798]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d areca,1 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886809]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,17 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886799]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d cciss,0 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886812]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,19 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886814]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,21 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886811]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,18 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886805]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d cciss,0 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886815]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,23 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886803]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d 3ware,0 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886804]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d areca,1 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886876]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,26 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886875]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,25 -j
    Jul 10 11:35:27 wort.lan.kitsnet.us sudo[886874]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,24 -j
    Jul 10 11:35:58 wort.lan.kitsnet.us sudo[887119]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/nvme0 -j
    Jul 10 11:36:08 wort.lan.kitsnet.us sudo[887180]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d sat -j
    Jul 10 11:36:19 wort.lan.kitsnet.us sudo[887272]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d sat -j
    Jul 10 11:36:58 wort.lan.kitsnet.us sudo[887678]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/nvme0 -j
    Jul 10 11:37:08 wort.lan.kitsnet.us sudo[887803]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d sat -j
    Jul 10 11:37:19 wort.lan.kitsnet.us sudo[887894]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d sat -j
    Jul 10 11:37:58 wort.lan.kitsnet.us sudo[888214]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/nvme0 -j
    Jul 10 11:38:08 wort.lan.kitsnet.us sudo[888286]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sdd -d sat -j
    Jul 10 11:38:19 wort.lan.kitsnet.us sudo[888389]: zabbix : PWD=/ ; USER=root ; COMMAND=/usr/local/sbin/smartctl-zabbix -a /dev/sde -d sat -j
    ​
    The first scan reveals all the devices:
    Code:
    /usr/local/sbin/smartctl-zabbix --scan -j
    {
    "json_format_version": [
    1,
    0
    ],
    "smartctl": {
    "version": [
    7,
    2
    ],
    "svn_revision": "5155",
    "platform_info": "x86_64-linux-5.14.0-570.23.1.el9_6.x86_64",
    "build_info": "(local build)",
    "argv": [
    "smartctl",
    "--scan",
    "-j"
    ],
    "exit_status": 0
    },
    "devices": [
    {
    "name": "/dev/sda",
    "info_name": "/dev/sda",
    "type": "scsi",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/sdb",
    "info_name": "/dev/sdb",
    "type": "scsi",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/sdc",
    "info_name": "/dev/sdc",
    "type": "scsi",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/sdd",
    "info_name": "/dev/sdd",
    "type": "scsi",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/sde",
    "info_name": "/dev/sde",
    "type": "scsi",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_17]",
    "type": "megaraid,17",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_18]",
    "type": "megaraid,18",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_19]",
    "type": "megaraid,19",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_20]",
    "type": "megaraid,20",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_21]",
    "type": "megaraid,21",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_23]",
    "type": "megaraid,23",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_24]",
    "type": "megaraid,24",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_25]",
    "type": "megaraid,25",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/bus/0",
    "info_name": "/dev/bus/0 [megaraid_disk_26]",
    "type": "megaraid,26",
    "protocol": "SCSI"
    },
    {
    "name": "/dev/nvme0",
    "info_name": "/dev/nvme0",
    "type": "nvme",
    "protocol": "NVMe"
    }
    ]
    }
    ​
    and the commands that follow show the Zabbux agent digging out the data for all the devices (e.g. /usr/local/sbin/smartctl-zabbix -a /dev/bus/0 -d megaraid,24 -j). However, the Zabiix server tracks only nvme0, sdd and sde.

    How do i convince Zabbix server to track the other devices?

    Leave a comment:


  • PavelZ
    replied
    it's very hard to imagine bare metal with 512Mb of RAM.
    Anyway I see auto discovery fail very often.
    It seems you misunderstood both me and the developers' motives : every small line that works for decades has its own support cost.
    Developer shouldn't rush to implement obvious features. He should think about how this will affect the entire product during its entire life cycle.

    What specific change do you propose in smart plugin autodiscovery? Let's make your proposal as a ZBXNEXT (that's what requests that are not bugs are called),
    and the developers will write to us.
    I also think that sometimes the ability to customize SMART autodiscovery might be useful.But I have no vision.​ I and other people will support this ZBXNEXT by pressing button.

    Leave a comment:


  • anmg
    replied
    Originally posted by PavelZ
    This is too complicated logic for small agent program.
    I think the existing scheme covers 95% of installations. We just don't see complaints from those for whom everything works.
    The rest can write a script or build a workaround.

    The difficulties mainly lie in the correct operation of autodiscovery. If you make a template that would allow you to specify these keys manually, everything will work too.
    I have access to about 100 of bare metal servers.
    it's very hard to imagine bare metal with 512Mb of RAM.

    Anyway I see auto discovery fail very often.
    Here is one situation:
    Smartctl --scan does not return anything, but zabbix-agent2 check the first drive only in RAID10 on Smart Array P410. (screenshot)
    and such situation is very often.

    another situation of wrong command is described above.

    As you can understand discovery include/exclude filters on template is useless in such situation.

    I would suggest to add auto discovery override for such cases.
    eg. set the string to use for drive analysis like: `-d sat /dev/sg[2-6]` or `/dev/sda -d cciss,[0-5]`

    more or less stable discovery is with drives without hardware RAID.
    Attached Files

    Leave a comment:


  • albertokg
    replied
    Hello,
    I have a Zabbix Server 7.2.5 with a Zabbix Agent 2 (ver 7.2.5) in Debian 12 and Smartctl version 7.3.
    The "SMART by Zabbix agent 2" template failed to collect the SMART metrics of my devices.

    The agent logs reports:


    Code:
    2025/04/18 14:06:14.228372 [Smart] executed smartctl command: sudo -n smartctl --scan -j Got output: "{\n  \"json_format_version\": [\n    1,\n    0\n  ],\n  \"smartctl\": {\n    \"version\": [\n      7,\n      3\n    ],\n    \"svn_revision\": \"5338\",\n    \"platform_info\": \"x86_64-linux-6.1.0-32-amd64\",\n    \"build_info\": \"(local build)\",\n    \"argv\": [\n      \"smartctl\",\n      \"--scan\",\n      \"-j\"\n    ],\n    \"exit_status\": 0\n  },\n  \"devices\": [\n    {\n      \"name\": \"/dev/sda\",\n      \"info_name\": \"/dev/sda\",\n      \"type\": \"scsi\",\n      \"protocol\": \"SCSI\"\n    }\n  ]\n}\n"
    2025/04/18 14:06:14.303393 [Smart] executed smartctl command: sudo -n smartctl --scan -d sat -j Got output: "{\n  \"json_format_version\": [\n    1,\n    0\n  ],\n  \"smartctl\": {\n    \"version\": [\n      7,\n      3\n    ],\n    \"svn_revision\": \"5338\",\n    \"platform_info\": \"x86_64-linux-6.1.0-32-amd64\",\n    \"build_info\": \"(local build)\",\n    \"argv\": [\n      \"smartctl\",\n      \"--scan\",\n      \"-d\",\n      \"sat\",\n      \"-j\"\n    ],\n    \"exit_status\": 0\n  },\n  \"devices\": [\n    {\n      \"name\": \"/dev/sda\",\n      \"info_name\": \"/dev/sda\",\n      \"type\": \"scsi\",\n      \"protocol\": \"SCSI\"\n    }\n  ]\n}\n"
    2025/04/18 14:06:14.447455 [Smart] failed to get device "/dev/sda" info by type "3ware": Failed to execute smartctl: "{\n  \"json_format_version\": [\n    1,\n    0\n  ],\n  \"smartctl\": {\n    \"version\": [\n      7,\n      3\n    ],\n    \"svn_revision\": \"5338\",\n    \"platform_info\": \"x86_64-linux-6.1.0-32-amd64\",\n    \"build_info\": \"(local build)\",\n    \"argv\": [\n      \"smartctl\",\n      \"-a\",\n      \"-d\",\n      \"3ware,0\",\n      \"/dev/sda\",\n      \"-j\"\n    ],\n    \"exit_status\": 2\n  },\n  \"local_time\": {\n    \"time_t\": 1744977974,\n    \"asctime\": \"Fri Apr 18 14:06:14 2025 CEST\"\n  },\n  \"device\": {\n    \"name\": \"/dev/sda\",\n    \"info_name\": \"/dev/sda [3ware_disk_00]\",\n    \"type\": \"3ware\",\n    \"protocol\": \"ATA\"\n  }\n}": exit status 2.
    2025/04/18 14:06:14.456057 [Smart] failed to get device "/dev/sda" info by type "areca": Failed to execute smartctl: "{\n  \"json_format_version\": [\n    1,\n    0\n  ],\n  \"smartctl\": {\n    \"version\": [\n      7,\n      3\n    ],\n    \"svn_revision\": \"5338\",\n    \"platform_info\": \"x86_64-linux-6.1.0-32-amd64\",\n    \"build_info\": \"(local build)\",\n    \"argv\": [\n      \"smartctl\",\n      \"-a\",\n      \"-d\",\n      \"areca,1\",\n      \"/dev/sda\",\n      \"-j\"\n    ],\n    \"messages\": [\n      {\n        \"string\": \"Smartctl open device: /dev/sda [areca_disk#01_enc#01] failed: Input/output error\",\n        \"severity\": \"error\"\n      }\n    ],\n    \"exit_status\": 2\n  },\n  \"local_time\": {\n    \"time_t\": 1744977974,\n    \"asctime\": \"Fri Apr 18 14:06:14 2025 CEST\"\n  }\n}": exit status 2.
    2025/04/18 14:06:14.459970 [Smart] failed to get device "/dev/sda" info by type "cciss": Failed to execute smartctl: "{\n  \"json_format_version\": [\n    1,\n    0\n  ],\n  \"smartctl\": {\n    \"version\": [\n      7,\n      3\n    ],\n    \"svn_revision\": \"5338\",\n    \"platform_info\": \"x86_64-linux-6.1.0-32-amd64\",\n    \"build_info\": \"(local build)\",\n    \"argv\": [\n      \"smartctl\",\n      \"-a\",\n      \"-d\",\n      \"cciss,0\",\n      \"/dev/sda\",\n      \"-j\"\n    ],\n    \"messages\": [\n      {\n        \"string\": \"Smartctl open device: /dev/sda [cciss_disk_00] [SCSI/SAT] failed: INQUIRY [SAT]: No such device or address\",\n        \"severity\": \"error\"\n      }\n    ],\n    \"exit_status\": 2\n  },\n  \"local_time\": {\n    \"time_t\": 1744977974,\n    \"asctime\": \"Fri Apr 18 14:06:14 2025 CEST\"\n  }\n}": exit status 2.
    2025/04/18 14:06:14.702737 [Smart] failed to get device "/dev/sda" info by type "scsi": Failed to execute smartctl: "{\n  \"json_format_version\": [\n    1,\n    0\n  ],\n  \"smartctl\": {\n    \"version\": [\n      7,\n      3\n    ],\n    \"svn_revision\": \"5338\",\n    \"platform_info\": \"x86_64-linux-6.1.0-32-amd64\",\n    \"build_info\": \"(local build)\",\n    \"argv\": [\n      \"smartctl\",\n      \"-a\",\n      \"-d\",\n      \"scsi\",\n      \"/dev/sda\",\n      \"-j\"\n    ],\n    \"exit_status\": 4\n  },\n  \"local_time\": {\n    \"time_t\": 1744977974,\n    \"asctime\": \"Fri Apr 18 14:06:14 2025 CEST\"\n  },\n  \"device\": {\n    \"name\": \"/dev/sda\",\n    \"info_name\": \"/dev/sda\",\n    \"type\": \"scsi\",\n    \"protocol\": \"SCSI\"\n  },\n  \"user_capacity\": {\n    \"blocks\": 1465149168,\n    \"bytes\": 750156374016\n  },\n  \"logical_block_size\": 512,\n  \"physical_block_size\": 4096,\n  \"scsi_lb_provisioning\": {\n    \"name\": \"fully provisioned\",\n    \"value\": 0,\n    \"management_enabled\": {\n      \"name\": \"LBPME\",\n      \"value\": 0\n    },\n    \"read_zeros\": {\n      \"name\": \"LBPRZ\",\n      \"value\": 0\n    }\n  },\n  \"rotation_rate\": 5400,\n  \"form_factor\": {\n    \"scsi_value\": 3,\n    \"name\": \"2.5 inches\"\n  },\n  \"logical_unit_id\": \"0x5000cca72bdb7201\",\n  \"serial_number\": \"J1140021DYBN6J\",\n  \"device_type\": {\n    \"scsi_terminology\": \"Peripheral Device Type [PDT]\",\n    \"scsi_value\": 0,\n    \"name\": \"disk\"\n  },\n  \"smart_support\": {\n    \"available\": false\n  },\n  \"temperature\": {\n    \"current\": 0\n  },\n  \"scsi_temperature\": {\n    \"drive_trip\": 0\n  }\n}": exit status 4.
    What is wrong?

    Regards,
    Alberto

    Leave a comment:


  • goegoegoe
    replied
    If smartctl exit-code is not 0,
    I cannot get SMART DISK monitoring.


    Zabbix Server 7.0.11
    Zabbix Agent2 7.0.11
    OS: Debian 12.10
    smartmontools release 7.3

    I can get Disk info. by smartctl
    smartctl exit-code is 32

    Code:
    #smartctl -a /dev/sdc
    smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.8.12-8-pve] (local build)
    Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF INFORMATION SECTION ===
    Model Family: Seagate BarraCuda 3.5 (SMR)
    ........
    Selective self-test flags (0x0):
    After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    # echo $?
    32
    By zabbix-get, I cannot get Disk info.
    Code:
    # zabbix_get -s 192.168.xx.xx -k smart.disk.get[/dev/sde,"sat"]
    ZBX_NOTSUPPORTED: cannot parse response: cannot find pair with name "value"
    Zabbix Agent2 7.0.11(Zabbix pkg) :NG
    Zabbix Agent2 6.0.14(Debian repo): OK
    Zabbix Agent2 6.0.39(Zabbix pkg) : OK
    Zabbix Agent2 7.0.11 source modify and compile : OK
    Code:
    # zabbix_get -s 192.168.xx.xx -k smart.disk.get[/dev/sde,"sat"]
    {"airflow_temperature_cel":{"value":258556035114," raw":"42 (Min/Max 36/51 #60)","normalized_value":58},
    .....
    ,"exit_status":32,"firmware_version":"0001",
    .....
    ,"udma_crc_error_count":{"value":0,"raw":"0","norm alized_value":200}}
    Source modification details
    Code:
    # diff zabbix-7.0.11/src/go/plugins/smart/controller.go zabbix-7.0.11.org/src/go/plugins/smart/controller.go
    90,91c90
    < return out,nil
    < //return nil, errs.Wrapf(err, "%q", strings.TrimSuffix(string(out), "\n"))
    ---
    > return nil, errs.Wrapf(err, "%q", strings.TrimSuffix(string(out), "\n"))
    Modified by comparing with zabbix-6.0.39 source

    Leave a comment:


  • PavelZ
    replied
    This is too complicated logic for small agent program.
    I think the existing scheme covers 95% of installations. We just don't see complaints from those for whom everything works.
    The rest can write a script or build a workaround.


    smartctl -d sat --all /dev/sg2
    The difficulties mainly lie in the correct operation of autodiscovery. If you make a template that would allow you to specify these keys manually, everything will work too.
    Last edited by PavelZ; 06-04-2025, 20:57.

    Leave a comment:


  • anmg
    replied
    raid check logic i very simple.
    why not use lspci | grep RAID to check RAID adapter, then use the respective command strategy according to discovered RAID type?

    Leave a comment:


  • anmg
    replied
    Originally posted by PavelZ

    For now, I suggest using the technique with a workaround program (like this https://github.com/pavlozt/somezabbi...er/workarounds) You will need to write your own script
    this way is working
    Code:
    smartctl -d sat --all /dev/sg2
    , so I need to know how to make zabbix use this

    Leave a comment:


  • PavelZ
    replied
    as you can see aacraid is not tested
    You are right. The agent source code confirms this


    smartctl -a -d aacraid,0,0,2
    However, maybe the main reason is precisely that it requires specifying driver parameters with numbers?

    For now, I suggest using the technique with a workaround program (like this https://github.com/pavlozt/somezabbi...er/workarounds) You will need to write your own script

    Leave a comment:

Working...