Zabbix Server 和 Zabbix Agentd 开机自动运行

Zabbix Server 和 Zabbix Agentd 开机自动运行

请问:怎样 Zabbix Server 和 Zabbix Agentd 开机自动运行?

注:如果你的命令行写进了 /etc/rc.local里面,重启机器,并没有开机启动。请看rc.local 软连接是否有x的权限,并进行赋值权限

采纳答案   步骤如下:

1. 复制 zabbix 源程序 misc/init.d/redhat 下的启动脚本到 /etc/init.d 目录下
cp /zabbix/zabbix-1.6.6/misc/init.d/redhat/zabbix_server_ctl /etc/init.d/zabbix_server
cp /zabbix/zabbix-1.6.6/misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentd

2. 修改启动脚本使其支持 redhat 的 chkconfig,分别在两个脚本的 #!/bin/sh 后加入如下两行注释,注意要行前要加“#” 哦
# chkconfig: - 95 95
# description: Zabbix Server

3. Zabbix agentd修改启动脚本中 BASEDIR 和 ZABBIX_SUCKERD ,制定到 zabbix_server 和 zabbix_agentd 的安装位置,如:
BASEDIR=/usr/local/sbin
ZABBIX_SUCKERD=$BASEDIR/zabbix_server

4. Zabbix agentd使用 chkconfig 将其加入 init 的启动服务
chkconfig --add zabbix_server
chkconfig --add zabbix_agentd
chkconfig --level 345 zabbix_server on
chkconfig --level 345 zabbix_agentd on

5. 使用 chkconfig --list 检查一下
chkconfig --list | grep zabbix
输出如下:
zabbix_agentd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
zabbix_server 0:off 1:off 2:off 3:on 4:on 5:on 6:off

最后重启linux服务器看实验结果

原文地址:https://www.cnblogs.com/Su-per-man/p/10070919.html