Reference website; http://blog.51cto.com/13589448/2070180
Insufficient permissions prompt:
Server side prompt:
[root@yao local]# zabbix_get -s 10.116.0.41 -p 10050 -k "test"
sh: /root/zabbix_agent/scripts/test.sh: Insufficient permissions
Agent side switch user test;
If I can't execute the command by switching the user identity, I suddenly realized that the zabbix user cannot enter the root user's home directory. As can be seen from the figure below, the permission of the /root directory is 550, and zabbix cannot enter, not to mention The command is executed.
4. Problem solving
Put the script to be run under a directory that the zabbix user can execute. For uniform specification, place all scripts in the /etc/zabbix/scripts directory.
1. Common script directory
~]# mkdir -pv /etc/zabbix/scripts ~]# cp /root/bin/baidu.sh /etc/zabbix/scripts
2. Modify the zabbix-agent configuration file
3. Restart zabbix-agent
~]# service zabbix-agent restart