Skip to content

Instantly share code, notes, and snippets.

@marvin
Last active October 4, 2021 10:42
Show Gist options
  • Save marvin/5c666df9c378b91769f011d89fa563b0 to your computer and use it in GitHub Desktop.
Save marvin/5c666df9c378b91769f011d89fa563b0 to your computer and use it in GitHub Desktop.
centos7 Zabbix_agent2 Systemd Service Config
# install under /etc/systemd/system/zabbix_agent2.service
[Unit]
Description=Zabbix Agent 2
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent
Type=simple
Restart=on-abort
PIDFile=/run/zabbix/zabbix_agentd.pid
KillMode=control-group
ExecStart=/usr/local/sbin/zabbix_agent2 -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment