导航

centos7 zabbix 自启动 设定

Posted on 2019-06-19 17:41  nervalpoet  阅读(1389)  评论(0编辑  收藏  举报

vi /usr/lib/systemd/system/zabbix-server.service

[Unit]
Description=Zabbix
After=network.target

[Service]
Environment="CONFFILE=/usr/local/zabbix-4.0.1/etc/zabbix_server.conf"
Type=forking
Restart=on-failure
PIDFile=/tmp/zabbix_server.pid
KillMode=control-group
ExecStart=/usr/local/zabbix-4.0.1/sbin/zabbix_server -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s

[Install]
WantedBy=multi-user.target

--------------------------------------------

systemctl enable zabbix-server

------------------------------------