9394952

导航

关于zabbix后台运行的环境变量

参看:

https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/37309-userparameter-execution-environment

https://www.reddit.com/r/zabbix/comments/bkokws/zabbix_server_environment_variables/

当zabbix-agent调用外部脚本时,有时需要一定的环境变量,例如ORA_HOME等,这种情部下,就需要设置zabbix-agent的后台运行环境变量,添加一个/etc/sysconfig/zabbix-agent文件,内容为:(不需要export)

ORACLE_HOME=/usr/lib/oracle/11.2/client64
TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH:/usr/lib64:/usr/lib
ORABIN=/usr/lib/oracle/11.2/client64/bin
PATH=$PATH:$ORABIN:$ORACLE_HOME:$HOME/bin:$ORACLE_HOME/bin

 记住:添加环境变量文件后,一定要重启zabbix_agentd

 

posted on 2022-09-26 20:54  9394952  阅读(166)  评论(0编辑  收藏  举报