I want to send a item directly to server using zabbix sender, but the host is configured to use a proxy. I tried and it fails. There is some way to do that?
Ad Widget
Collapse
Bypass proxy using zabbix sender
Collapse
X
-
We also REALLY need this - we have lots of proxies but also some central things like syslog scanning so we need to send info via sender to the central zabbix server for any host, even if that host is on a proxy.
Seems the server will only data for a given host on a proxy from that proxy.
We've looked at changing the source to allow this, though having a bit of trouble finding where this check is done, and also any risks of this.
After a quick look, maybe get_proxy_id() is failing if proxy doesn't match.
Or process_trap() is failing somewhere, or maybe function get_proxy_id() in proxy.c is not returning a valid ID.
We can trace/dig more but hopefully someone can tell us where we can relax this constraint so we can send data on any host. -
You can use zabbix sender to send as *any* host. E.g. if I'm on the machine foo, I can send as if I were on bar using zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -s foo -k mysql.queries -o 342.45
You can then restrict who can send where using the Allowed Host field on a trapper item (which you can set to a macro value, then set a macro on each host using the API)Comment
-
Any updates on this? I was thinking about doing sql inserts directly but I'm not sure if that will bypass triggers.Comment
-
Unfortunately you can't do this or you will miss the triggers and also I think have problems with IDs which are generated in the server.
Basically triggers are evaluated in the server during the DB storage process, so you can't bypass this.
We are working on patches for 2.4 on this, but the way items are cached and looked up in the relevant function changed from 2.2 to 2.4.
We should have a patch ready this month.Comment
-
Any update on this one? I have a script running on my zabbix server which processes mail from a imap mailbox. The script uses zabbix_sender to update specific hosts. Some hosts are monitored by zabbix server directly, some are monitored by proxies. I need to be able to update all hosts via this script.
TIA,
WouterComment
-
Yes, we have a patch for 2.4 which turned out to be different and much simpler than what we had to do for 1.8
Looking at our Git system, would seem following - let me know if not clear as been a long while since I've looked at this - basic idea is to get server to ignore fact that this host is not directly monitored for any trapper item:
Change is in zabbix-2.4.1/src/libs/zbxdbhigh/proxy.c (see the - and + for diff changes)
if (SUCCEED != errcodes[i])
continue;
- if (proxy_hostid != items[i].host.proxy_hostid)
+ if (ITEM_TYPE_TRAPPER != items[i].type && proxy_hostid != items[i].host.proxy_hostid)
continue;
if (ITEM_STATUS_ACTIVE != items[i].status)Comment
-
OK, thanks. I will give that a try. This will be overwritten when I update zabbix server, right? I was already rewriting my script to retrieve the IP address/DNS name of the configured proxy for each host. Turned out I had to switch from active proxy to passive proxy to be able to set an IP address for the proxy. This changed and a firewall rule added at the remote site, enabled using zabbix_sender through the remote proxy.
TIA,
WouterComment
-
Comment
-
Hello, i'm facing the same use case as some of you, need to send trappers to an host by addressing the zabbix server directly, but to an host attached to a proxy.
Someone can confirm there is a working solution in recent version ? (we are running 3.14 here). thksComment

Comment