解决办法:
1)确保zabbix的agent客户机的zabbix有sudo权限
[root@web01 ~]# chattr -i /etc/sudoers
[root@web01 ~]# chmod 640 /etc/sudoers
[root@web01 ~]# echo "zabbix ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
[root@web01 ~]# chmod 440 /etc/sudoers
[root@web01 ~]# chattr +i /etc/sudoers
2)修改zabbix的server服务器端fping的权限 ,这一步很重要!!
[root@zabbix01 ~]# ll /usr/local/sbin/fping
-rwxr-xr-x 1 root root 67110 12月 11 17:18 /usr/local/sbin/fping
[root@zabbix01 ~]# chmod u+s /usr/local/sbin/fping
然后切换到zabbix用户下进行测试
[root@zabbix01 ~]# su - zabbix
[zabbix@zabbix01 ~]$ /usr/local/sbin/fping -s oa-mob01.kevin.cn
oa-mob01.kevin.cn is alive
1 targets
1 alive
0 unreachable
0 unknown addresses
0 timeouts (waiting for response)
1 ICMP Echos sent
1 ICMP Echo Replies received
0 other ICMP received
0.58 ms (min round trip time)
0.58 ms (avg round trip time)
0.58 ms (max round trip time)
0.001 sec (elapsed real time
如果返回 XX.XX.XX.XX is alive,那说明是OK的了!