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

sudo messages #142

Open Jancs-E opened 4 years ago

Jancs-E commented 4 years ago

Hi! I have to note each time I try to install your srcipts it is some kind of woodoo process, this time too -
I have Zabbix 5 server/agent and I try to start SMART monitoring using your latest script (template 3.4)

On the server using CLI, everything works: sudo -u zabbix /usr/sbin/smartctl -i -H -A -l error -l background /dev/sda -d sat || true returns the expected results (with -u zabbixagent, too), detection works, but getting smart parameters in the expected automated process - no. I get such "spam" for each of the detected devices:

We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

What specific agent setting are required for it to run? Allow to run as root? suid smartctl? what else? may be this "true" also shuold be sudo-ed?

How can I test what is wrong?