# https://cdn.zabbix.com/zabbix/sources/stable/7.0/zabbix-7.0.22.tar.gz
./configure --enable-agent2 --with-libpcre2 --with-libcurl --with-openssl --with-libxml2 --with-postgresql
make
make install
# https://cdn.zabbix.com/zabbix-agent2-plugins/sources/postgresql/zabbix-agent2-plugin-postgresql-7.0.22.tar.gz
make
cp zabbix-agent2-plugin-* /usr/local/sbin
cp *.conf /etc/zabbix/zabbix_agent2.d/plugins.d/
# set System.Path in plugin conf
[Unit]
Description=Zabbix Agent 2
After=syslog.target
After=network.target
[Service]
RuntimeDirectory=zabbix
Environment="CONFFILE=/etc/zabbix/zabbix_agent2.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent2
Type=simple
Restart=on-failure
PIDFile=/run/zabbix/zabbix_agent2.pid
KillMode=control-group
ExecStart=/usr/local/sbin/zabbix_agent2 -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
LimitNOFILE=8192
[Install]
WantedBy=multi-user.target