agent端配置
1.如果是java的找不到环境变量需要修改:/etc/sudoers
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/java/bin
2.添加sudo权限
cat /etc/sudoers.d/zabbix
zabbix? ALL=NOPASSWD: /usr/sbin/dmidecode,/opt/MegaRAID/MegaCli/MegaCli64,/usr/sbin/lspci,/data/kafka/kafka_2.12-2.3.0/bin/kafka-server-start.sh,/usr/local/java/bin/java
3.添加AllowKey=system.run[*]配置
[root@elk03 ~]# grep AllowKey /etc/zabbix/zabbix_agent2.conf.
AllowKey=system.run[*]
4.重启agent
server端