起因是本地运行zabbix的脚本没问题,但是在zabbix proxy上zabbix_get显示:
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: no tty present and no askpass program specified
因为zabbix_get使用的zabbix用户,没有sudo权限。
修改/etc/sudoers文件(此文件是只读文件,需先修改文件权限),添加
zabbix ALL=(ALL) NOPASSWD: $所需命令的执行文件所在绝对路径或者ALL
最后记得把文件权限改回只读