v-zhuravlev / zbx-smartctl

Templates and scripts for monitoring disks health with Zabbix and smartmontools
https://share.zabbix.com/storage-devices/smartmontools/smart-monitoring-with-smartmontools-lld
GNU General Public License v3.0
245 stars 127 forks source link

Zabbix agent does not sending data - Unsupported item key #162

Open liashukvladyslav opened 3 years ago

liashukvladyslav commented 3 years ago

Cannot fetch data from server with 2 attached directly disks from zabbix server.

Running perl discovery script itself on monitored node as a zabbix user returns data correctly

# sudo -u zabbix sudo /etc/zabbix/scripts/smartctl-disks-discovery.pl

{
    "data":[
        {
            "{#DISKMODEL}":"SAMSUNG MZ7LM480HMHQ-00005",
            "{#DISKSN}":"S2UJNX0M502684",
            "{#DISKNAME}":"/dev/sda",
            "{#DISKCMD}":"/dev/sda -d sat",
            "{#SMART_ENABLED}":"1",
            "{#DISKTYPE}":"1"
        },
        {
            "{#DISKMODEL}":"SAMSUNG MZ7LM480HMHQ-00005",
            "{#DISKSN}":"S2UJNX0M506845",
            "{#DISKNAME}":"/dev/sdb",
            "{#DISKCMD}":"/dev/sdb -d sat",
            "{#SMART_ENABLED}":"1",
            "{#DISKTYPE}":"1"
        }
    ]
}

Attempt to fetch same data from zabbix server zabbix_get -s 1.2.3.4 -p 10050 -k uSSD.discovery[""] ZBX_NOTSUPPORTED: Unsupported item key.

From monitored server zabbix-agent logs (debug level):

10829:20210412:134723.739 Requested [uSSD.discovery[]]
10829:20210412:134723.739 Sending back [ZBX_NOTSUPPORTED: Unsupported item key.]

Zabbix server version 4.2.8

Montiored server details:

Side note: same setup, though with older smartmontools and zabbix-agent working correctly on other monitored Centos 6-based server.

dazgluk commented 3 years ago

Having the same issue on Ubuntu 20.04 LTS and Zabbix 4.4.6

dazgluk commented 3 years ago

Fixed an issue for my self, there was a permission issue, zabbix user had no access to newly created /etc/zabbix/conf.d/ file

proteus88 commented 3 years ago

Had the same problem "Unsupported item key", the zabbix agent config file did not know about the zabbix_smartctl.conf file, I had to add this line Include=/etc/zabbix/zabbix_agentd.d/*.conf

tommer-cpu commented 1 week ago

Had the same problem "Unsupported item key", the zabbix agent config file did not know about the zabbix_smartctl.conf file, I had to add this line Include=/etc/zabbix/zabbix_agentd.d/*.conf

Всем привет!У меня вот какая проблема jqbqXgp5xyw

proteus88 commented 1 week ago

If you use Zabbix Agent 2 you don't need this template/script. Just use the official template from Zabbix and "sudo apt install smartmontools" then add "zabbix ALL=(ALL) NOPASSWD:/usr/sbin/smartctl" with "sudo visudo" command.

https://www.zabbix.com/integrations/smart