Short note: 2 zabbix servers one client

    As a monitoring system , we use zabbix. Recently, one of the clients asked / asked if the server can also connect to its zabbix server.

    Reading the documentation suggested that there is no obvious solution and that one client can only accept requests from one server. But nothing is impossible. After a little reflection and observing the operation 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 on the desired server and configure it on a different port, tweak the autorun script a bit and run the second zabbix agent.

    The following was added to the autorun script:

    init.d / zabbix-agent
    conf_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 for stop there and this led to the stop of both agents. In the event of a restart, it turned out that both agents stopped, and only one started.

    Posted by: Magvai69


    UPD The
    error came out.
    Correctly done through
    Server = 192.168.0.1,192.168.0.2
    ServerActive = 192.168.0.1,192.168.0.2
    Thank you! )

    Also popular now: