Ad Widget

Collapse

Discussion thread for official Zabbix SMART Disk monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • beriapl
    replied
    Originally posted by anmg
    I have different results with running smartctl:
    Code:
    sudo -u zabbix /usr/local/sbin/smartctl --scan
    ---- I get only virtual drive

    Code:
    sudo -u zabbix sudo /usr/local/sbin/smartctl --scan
    ---- I get full drive list (screenshot is for both commands)

    so when i run
    Code:
    zabbix_get -shostname -p 10050 -k smart.disk.discovery
    I have empty reply
    Code:
    []
    smartmotools v. 7.3-7.4
    zabbix-agent 6.4.10
    I've got a similar issue.

    Locally all commands work well, but zabbix_get from the zabbix server is an empty response.

    Did you manage to sort it out?

    Code:
    root@pve01-01:~# ip a | grep vlan25
    12: vlan25@vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        inet 10.2.128.67/17 scope global vlan25
    root@pve01-01:~# sudo -u zabbix /usr/sbin/smartctl --scan
    /dev/sda -d scsi # /dev/sda, SCSI device
    /dev/sdb -d scsi # /dev/sdb, SCSI device
    /dev/sdc -d scsi # /dev/sdc, SCSI device
    /dev/sdd -d scsi # /dev/sdd, SCSI device
    root@pve01-01:~# sudo -u zabbix sudo /usr/sbin/smartctl --scan
    /dev/sda -d scsi # /dev/sda, SCSI device
    /dev/sdb -d scsi # /dev/sdb, SCSI device
    /dev/sdc -d scsi # /dev/sdc, SCSI device
    /dev/sdd -d scsi # /dev/sdd, SCSI device
    /dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
    /dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
    /dev/bus/0 -d megaraid,5 # /dev/bus/0 [megaraid_disk_05], SCSI device
    /dev/bus/0 -d megaraid,6 # /dev/bus/0 [megaraid_disk_06], SCSI device
    /dev/bus/0 -d megaraid,7 # /dev/bus/0 [megaraid_disk_07], SCSI device
    Code:
    root@zabbix6:~# zabbix_get -s 10.2.128.67 -k smart.disk.discovery
    []
    root@zabbix6:~# zabbix_get -s 10.2.128.67 -k smart.disk.get
    []
    However it is the same with zabbix_agent locally:

    Code:
    root@pve01-01:~# zabbix_agent2 -t smart.disk.get
    smart.disk.get                                [s|[]]
    root@pve01-01:~# sudo -u zabbix zabbix_agent2 -t smart.disk.get
    smart.disk.get                                [s|[]]
    ​
    smartctl 7.3
    zabbix_agent2 (Zabbix) 6.4.13
    Revision 6e531c40ff3 25 March 2024, compilation time: Mar 25 2024 15:21:36
    Plugin communication protocol version is 6.4.0

    zabbix_server (Zabbix) 6.4.13
    Revision 6e531c40ff3 25 March 2024, compilation time: Mar 25 2024 15:12:00
    Last edited by beriapl; 23-04-2024, 13:09.

    Leave a comment:


  • schoeppi
    replied
    Once per day I get this message for all disks in all our servers:

    Problem name: SMART [sdXYZ sat]: Disk self-test is not passed

    This seems to be a bug which occures when a selftest is running for the disks on the servers which is the case for our machines.

    Do you have the same issue and how do you handle it? Do you have selftests deactivated?

    Now I've changed the trigger to this to hopefulle stop this error till it is fixed in the smart zabbix agnet2 active template, but I don't know if this the right approach:

    last(/SMART by Zabbix agent 2/smart.disk.test[{#NAME}],#1)="false" and last(/SMART by Zabbix agent 2/smart.disk.test[{#NAME}],#2)="false"

    What do you think and how do you get around this bug?

    Leave a comment:


  • Zsolt
    commented on 's reply
    Looks like the smart is starting to work, so the only real problem was the too old smartctl.

  • Zsolt
    commented on 's reply
    Alright, after some backwork I figured out this was an issue because of the debian 10 APT repo, which doesn't support smartmontool above v6.6. I tried on a different client with debian 11, now I don't have any error messages about this, but I still cannot find any smart data in the zabbix web interface.

    If I run zabbix_get from the server, I get a JSON array with the disk data on the client, but on the zabbix UI I still only see an empty `SMART: Get attributes` item and that's it. No other smart metrics or whatsoever. Do I have to change some settings maybe, or am I still missing some key features?

  • Zsolt
    replied
    Hi,

    I'm having some difficulties with the smart plugin. I'm using Debian 10 on both my server and client:
    Code:
    Server: debian 10 4.19.0-17-amd64, zabbix: 6.0.0 Revision 5203d2ea7d
    Client: debian 11 5.10.0-0.bpo.12-amd64, zabbix: 6.0.0 Revision 5203d2ea7d
    I installed the zabbix-agent2 on the client, setup its config, added `SMART by Zabbix agent 2​` template to this host on the zabbix web interface.
    However, all I get as smart response is a faulty smart.disk.get with the following error message:

    error: 'Cannot fetch data: Failed to scan for devices: Cannot unmarshal JSON: invalid character 's' looking for beginning of value..'

    ​After fiddling with every possibility (double checking permissions, installed modules and packages, everything I could think of), I finally found something useful in the logs:
    Code:
    2024/04/03 15:57:48.194180 received passive check request: 'smart.disk.discovery' from '10.0.0.215'
    2024/04/03 15:57:48.194265 [1] processing update request (1 requests)
    2024/04/03 15:57:48.194288 [1] adding new request for key: 'smart.disk.discovery'
    2024/04/03 15:57:48.194300 [1] created direct exporter task for plugin 'Smart' itemid:0 key 'smart.disk.discovery'
    2024/04/03 15:57:48.194372 executing direct exporter task for key 'smart.disk.discovery'
    2024/04/03 15:57:48.194468 [Smart] executing smartctl command: sudo -n smartctl --scan -j
    2024/04/03 15:57:48.207429 [Smart] command sudo -n smartctl --scan -j smartctl raw response: smartctl 6.6 2017-11-05 r4594 [x86_64-linux-5.10.0-0.bpo.12-amd64] (local build)
    Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
    
    =======> UNRECOGNIZED OPTION: j
    
    Use smartctl -h to get a usage summary
    2024/04/03 15:57:48.207465 failed to obtain PID of dead child process: no child processes
    2024/04/03 15:57:48.207494 failed to execute direct exporter task for key 'smart.disk.discovery' error: 'Cannot fetch data: Failed to scan for devices: Cannot unmarshal JSON: invalid character 's' looking for beginning of value..'
    2024/04/03 15:57:48.207546 sending passive check response: ZBX_NOTSUPPORTED: 'Cannot fetch data: Failed to scan for devices: Cannot unmarshal JSON: invalid character 's' looking for beginning of value..' to '10.0.0.215'
    As I see, smartctl doesn't even have an option "-j", that's why I'm getting this otherwise completely useless error (the returned motd starts with smartctl version, thus with the letter s...). Did I miss something very obvious at the smartmontool install?

    Leave a comment:


  • vicyn
    replied
    Hi,
    I want to get "total byte written"(TWB). Smartctl shows the values "Sector Size" and "Total_LBAs_Written". TWB = Total_LBAs_Written * Sector Size / 1024*1024*1024*1024. In the zabbix template "SMART by Zabbix agent 2 active" i don't see metric "Sector Size". Please tell me how add metric "Sector Size​" to template?


    Last edited by vicyn; 07-02-2024, 11:36.

    Leave a comment:


  • Vladimir Goriachev
    replied
    ​How this trigger should work, I have Exit Status = 64 on several devices, and at the same time the trigger status is OK?
    SMART [{#NAME}]: Error log contains records The device error log contains records of errors. ( count(/SMART by Zabbix agent 2/smart.disk.es[{#NAME}],#2) = 1 and bitand(last(/SMART by Zabbix agent 2/smart.disk.es[{#NAME}]),64) = 64 ) or ( bitand(last(/SMART by Zabbix agent 2/smart.disk.es[{#NAME}]),64) = 64 and bitand(last(/SMART by Zabbix agent 2/smart.disk.es[{#NAME}]),64) > bitand(last(/SMART by Zabbix agent 2/smart.disk.es[{#NAME}],#2),64) )
    Click image for larger version

Name:	image.png
Views:	2247
Size:	7.0 KB
ID:	478407Click image for larger version

Name:	image.png
Views:	2209
Size:	4.9 KB
ID:	478408

    Leave a comment:


  • anmg
    replied
    I have different results with running smartctl:
    Code:
    sudo -u zabbix /usr/local/sbin/smartctl --scan
    ---- I get only virtual drive

    Code:
    sudo -u zabbix sudo /usr/local/sbin/smartctl --scan
    ---- I get full drive list (screenshot is for both commands)

    so when i run
    Code:
    zabbix_get -shostname -p 10050 -k smart.disk.discovery
    I have empty reply
    Code:
    []
    smartmotools v. 7.3-7.4
    zabbix-agent 6.4.10
    Attached Files
    Last edited by anmg; 31-01-2024, 18:18.

    Leave a comment:


  • Mr.BlueBear
    replied
    Originally posted by gabrielev
    Hello,
    could you add support for detecting SSD wearout ?
    In https://github.com/v-zhuravlev/zbx-smartctl this was supported.

    Thanks
    As per this post, Media Wearout is already supported with many disk. Mostly those using "percentage used".
    However, I too have a disk manufacturer / model that is not recognized. SuperMicro Sata-DOM.
    ID# ATTRIBUTE_NAME FLAG
    232 Available_Reservd_Space 0x0000

    Leave a comment:


  • gabrielev
    replied
    Hello,
    could you add support for detecting SSD wearout ?
    In https://github.com/v-zhuravlev/zbx-smartctl this was supported.

    Thanks

    Leave a comment:


  • gabrielev
    replied
    Originally posted by qds013
    Hello,

    I’m trying to setup SMART monitoring with zabbix-agent2 on Centos. Following official manuals, it’s not expected to be complicated – but I’m stuck with:
    Code:
    zabbix_agent2 -t smart.disk.discovery
    smart.disk.discovery [m|ZBX_NOTSUPPORTED] [Failed to execute smartctl: Command execution failed: exit status 1.]
    You are missing the /etc/sudores.d file.
    Read the doc of the templates.

    First try to get working the command:
    Code:
     sudo -u zabbix sudo smartctl -i /dev/sda

    Leave a comment:


  • qds013
    replied
    Hello,

    I’m trying to setup SMART monitoring with zabbix-agent2 on Centos. Following official manuals, it’s not expected to be complicated – but I’m stuck with:
    Code:
    zabbix_agent2 -t smart.disk.discovery
    smart.disk.discovery [m|ZBX_NOTSUPPORTED] [Failed to execute smartctl: Command execution failed: exit status 1.]
    ​After completing some basic checks – still have no clue what’s wrong in my setup:
    Code:
    zabbix_agent2 -V
    zabbix_agent2 (Zabbix) 6.4.7
    
    smartctl --scan
    /dev/sda -d scsi # /dev/sda, SCSI device
    /dev/sdb -d scsi # /dev/sdb, SCSI device
    /dev/sdc -d scsi # /dev/sdc, SCSI device
    
    sudo -u zabbix smartctl --scan
    /dev/sda -d scsi # /dev/sda, SCSI device
    /dev/sdb -d scsi # /dev/sdb, SCSI device
    /dev/sdc -d scsi # /dev/sdc, SCSI device
    
    sudo -u zabbix sudo smartctl --scan
    /dev/sda -d scsi # /dev/sda, SCSI device
    /dev/sdb -d scsi # /dev/sdb, SCSI device
    /dev/sdc -d scsi # /dev/sdc, SCSI device
    
    cat /etc/sudoers.d/zabbix
    zabbix ALL= (ALL) NOPASSWD: ALL
    ​Any idea?

    Leave a comment:


  • solution
    replied
    privileges,,, sudo?


    added to the /etc/sudoers file the lines
    Defaults:zabbix !requiretty
    zabbix ALL=(ALL) NOPASSWD:/usr/sbin/smartctl

    ***Replace with path correct for smartctl

    Wellington

    Leave a comment:


  • advlad
    replied
    CentOS 7
    smartmontools 7.2
    zabbix agent2 6.4
    Code:
    # zabbix_agent2 -t smart.disk.discovery
    
    smart.disk.discovery [s|[{"{#NAME}":"sda sat","{#DISKTYPE}":"hdd","{#MODEL}":"ST1000DM003-1ER162","{#SN}":"Z4Y6X6NB","{#PATH}":"/dev/sda","{#RAIDTYPE}":"sat","{#ATTRIBUTES}":"Raw_Rea d _Error_Rate Spin_Up_Time Start_Stop_Count Reallocated_Sector_Ct Seek_Error_Rate Power_On_Hours Spin_Retry_Count Power_Cycle_Count Runtime_Bad_Block End-to-End_Error Reported_Uncorrect Command_Timeout High_Fly_Writes Airflow_Temperature_Cel G-Sense_Error_Rate Power-Off_Retract_Count Load_Cycle_Count Temperature_Celsius Current_Pending_Sector Offline_Uncorrectable UDMA_CRC_Error_Count Head_Flying_Hours Total_LBAs_Written Total_LBAs_Read"},{"{#NAME}":"sdb sat","{#DISKTYPE}":"hdd","{#MODEL}":"ST1000DM003-1ER162","{#SN}":"Z4Y6WWGG","{#PATH}":"/dev/sdb","{#RAIDTYPE}":"sat","{#ATTRIBUTES}":"Raw_Rea d _Error_Rate Spin_Up_Time Start_Stop_Count Reallocated_Sector_Ct Seek_Error_Rate Power_On_Hours Spin_Retry_Count Power_Cycle_Count Runtime_Bad_Block End-to-End_Error Reported_Uncorrect Command_Timeout High_Fly_Writes Airflow_Temperature_Cel G-Sense_Error_Rate Power-Off_Retract_Count Load_Cycle_Count Temperature_Celsius Current_Pending_Sector Offline_Uncorrectable UDMA_CRC_Error_Count Head_Flying_Hours Total_LBAs_Written Total_LBAs_Read"}]]

    CentOS 8
    zabbix server 6.4
    Code:
    # zabbix_get -s a.b.c.d -p 10050 -k smart.disk.discovery
    
    ZBX_NOTSUPPORTED: Cannot fetch data: Failed to scan for devices: Cannot unmarshal JSON: invalid character 's' looking for beginning of value..

    Is there a way to somehow debug this issue?​

    Leave a comment:


  • Taomyn
    replied
    Originally posted by Taomyn
    First time using this template and have hit the issue mentioned above by fl0w

    Code:
    2023/09/06 08:19:18.439408 check 'smart.disk.discovery' is not supported: Failed to execute smartctl: Command execution failed: exit status 127.
    2023/09/06 08:20:16.009943 check 'smart.disk.discovery' is not supported: Cannot fetch data: Failed to scan for devices: Cannot unmarshal JSON: invalid character 's' looking for beginning of value..

    Running Zabbix Server v6.4.6 and Agent v6.4.6 on Debian 12
    My bad, seems that sudo is not installed by default, which cured the problem.

    Leave a comment:

Working...