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

Error : Can't use string ("disk0") as a HASH ref while "strict refs" #53

Closed tifredfr closed 6 years ago

tifredfr commented 6 years ago

Hi,

I get the following error when I test the command under macOS 10.12.6 : sudo -u zabbix ./smartctl-disks-discovery.pl Can't use string ("disk0") as a HASH ref while "strict refs" in use at ./smartctl-disks-discovery.pl line 61.

Thx ;)

v-zhuravlev commented 6 years ago

Confirmed. Btw, how your disks are called? ls -lah /dev/disk*

v-zhuravlev commented 6 years ago

Try this fix: https://github.com/v-zhuravlev/zbx-smartctl/blob/8a7c8544715252c0c81028edb7e4fe8ba955863e/discovery-scripts/nix/smartctl-disks-discovery.pl

tifredfr commented 6 years ago

@v-zhuravlev The fix works for me :)

` { "data":[

    {
        "{#DISKNAME}":"disk0 ",
        "{#SMART_ENABLED}":"0"
    },
    {
        "{#DISKNAME}":"disk1 ",
        "{#SMART_ENABLED}":"0"
    }
]

}`