Using zabbix-proxy with multiple networks
-
I'm trying to use the zabbix-proxy to collect data from zabbix-agents across all of my different networks.
I set the 'Server=' value of all of my agents to 'mypfsense' (which is the hostname of my pfsense-box)
However, this only works on my main network (192.168.1.0/24). On other networks, this doesn't work, because mypfsense resolves to 192.168.1.1 everywhere.
So, when I set the Server= of a host in the 192.168.2.0/24 network to 'mypfsense' I get the following error:
failed to accept an incoming connection: connection from "192.168.2.1" rejected, allowed hosts: "mypfsense"
So, the zabbix-proxy on pfsense uses 192.168.2.1 to connect to the agent, but the agent expects mypfsense, which is 192.168.1.1
Obviously, I can just change the 'Server' value in the agents to 192.168.2.1 (instead of mypfsense). But that's not a very clean approach. If the host should ever change networks, I'd have to reconfigure it again.
Isn't there some type of 'dynamic' hostname for the pfsense gateway?
So it resolves the hostname differently, depending on which network requested it.
Hosts in 192.168.1.0/24 should get 192.168.1.1 as a response
And hosts in 192.168.2.0/24 should get 192.168.2.1 as a response.