We use zabbix as a monitoring system. Recently, one of the clients asked if he could connect the server to his zabbix server.
Reading the documentation suggested that there is no obvious solution and one client can only accept requests from one server. But nothing is impossible. After some thought and after observing the work of the zabbix agent, it was decided to run 2 agents on the same host, using the same binaries and different configuration files.
It remains only to make a second set of configuration files. Configure the second instance of the zabbix agent to the required server and configure it to another port, slightly correct the startup script and launch the second zabbix agent.
')
The autorun script has been added:
init.d / zabbix-agentconf_c=/etc/zabbix_client/zabbix_zgentd.conf lockfile_c=/var/lock/subsys/zabbix-agent_c .................................................................... start() { echo -n $"Starting Zabbix agent: " daemon $exec -c $conf rv=$? echo [ $rv -eq 0 ] && touch $lockfile return $rv echo -n $"Starting client Zabbix agent : " daemon $exec -c $conf_c rv=$? echo [ $rv -eq 0 ] && touch $lockfile_c return $rv }
In this configuration, everything works fine.
PS: Initially, there was an option to have two separate init scripts, but it turned out that killall was written to stop there and this caused both agents to be stopped. In the case of a restart, it turned out that both agents stopped, and only one was launched.
UPDThe error came out.
Do right through
Server = 192.168.0.1,192.168.0.2
ServerActive = 192.168.0.1,192.168.0.2
Thank! )