apt install smartmontools debhelper
cd /etc/zabbix wget https://github.com/v-zhuravlev/zbx-smartctl/archive/master.zip unzip master.zip rm master.zip cd zbx-smartctl-master dpkg-buildpackage -tc -Zgzip
vi /etc/zabbix/zabbix_agentd.conf add lines: #############SMARTMON UserParameter=uHDD[*], sudo smartctl -A $1| grep -i "$2"| tail -1| cut -c 88-|cut -f1 -d' ' UserParameter=uHDD.model.[*],sudo smartctl -i $1 |grep -i "Device Model"| cut -f2 -d: |tr -d " " UserParameter=uHDD.sn.[*],sudo smartctl -i $1 |grep -i "Serial Number"| cut -f2 -d: |tr -d " " UserParameter=uHDD.health.[*],sudo smartctl -H $1 |grep -i "test"| cut -f2 -d: |tr -d " " UserParameter=uHDD.errorlog.[*],sudo smartctl -l error $1 |grep -i "ATA Error Count"| cut -f2 -d: |tr -d " " UserParameter=uHDD.discovery,sudo /etc/zabbix/scripts/smartctl-disks-discovery.pl
visudo zabbix ALL= (ALL) NOPASSWD: /usr/sbin/smartctl,/etc/zabbix/scripts/smartctl-disks-discovery.pl
test run: /etc/zabbix/scripts/smartctl-disks-discovery.pl
service zabbix-agent restart
https://github.com/v-zhuravlev/zbx-smartctl
Zabbix -> Configuration -> Templates -> Import
Configuration -> Select one host -> Templates -> Search Template_HDD_SMARTMONTOOLS_2_WITH_LLD -> Add -> Update