If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to REGISTER before you can post. To start viewing messages, select the forum that you want to visit from the selection below.
Ad Widget
Collapse
[1.4] Error: ZBX_TCP_READ() failed [Connection reset by peer]
Explanation for fix:
The problem is that the ioctl operations that smartctl needs to use
(e.g., HDIO_DRIVE_TASKFILE) have additional permission checks inside
the kernel (CAP_SYS_ADMIN or CAP_SYS_RAWIO capabilities are needed).
This is due to the fact that these operations are even more dangerous
than access to raw data (some commands can even make the drive
unusable, e.g., by setting an ATA password, or even erasing the drive
firmware).
One possible solution is invoking smartctl through sudo - this way
smartctl will have full root privileges:
1.- As root add line to /etc/sudoers: echo zabbix ALL = NOPASSWD: /usr/sbin/smartctl >> /etc/sudoers
2.- Change effective user id: su - zabbix
3.- Try command /usr/bin/sudo /usr/sbin/smartctl -H /dev/hda | grep -i health | cut -d " " -f 6 | tr -d " ". It obtain "PASSED"
4.- Enter exit command to return to root user and add UserParameter=Disk.health,/usr/bin/sudo /usr/sbin/smartctl -H /dev/hda | grep -i health | cut -d " " -f 6 | tr -d " " line to zabbix_agentd.conf
5.- Test new parameter "zabbix_agentd -t Disk.health" and obtain [t|PASSED]
6.- Restart zabbix_agentd service
7.- Add new item with key "Disk.health", with type "Zabbix agent (active), and type of information "Character"
Other HD smart parameters can be monitorized from zabbix...
Comment