zbx-sadman / unifi_proxy

Fast client-server version of UniFi Miner
45 stars 21 forks source link

Buffer overload #44

Open romoromor opened 3 years ago

romoromor commented 3 years ago

Hi,

please, in our system is lot of AP devices and unifi_proxy_get return result, which has maximum count of chars in script (Buffer 65536). I know, i can modify it and rebuild, but same problem is in Zabbix, where is limit of buffer also 65536.

Do you know some issue except rebuild whole Zabbix for solve this? For example something like separate results and make more discovery jobs.

Thanks

zbx-sadman commented 3 years ago

Hello

As I know Zabbix's LLD parser limited by 65K for one line - data block ending with newline character ('\n'). Whole 'packet' can be bigger.

Therefore, actual release of Zabbix server can process huge data block, but with 65K lines.

Using Pretty JSON stringify method in the UniFi Proxy/Miner should solve "65K problem". But buffer in the _unifi_proxyget.c file must be growht and utility must me recompiled.

romoromor commented 3 years ago

Hi,

i increased MAX_BUFFER_LEN to 131072 in both files. unifi_proxy.pl - on line 90 unifi_proxy_get.c - on line 7 unifi_proxy_get i recompiled

I restarted unifi_proxy and then i tried to execute /usr/local/bin/zabbix/unifi_proxy_get 127.0.0.1 8448 "discovery,uap" But i have still same shorted result :-/

When i tried to modify unifi_miner.pl MAX_BUFFER_LEN to 131072 and execute miner script, i have full result without problem. But this method is very slow and Zabbix don't like this.

zbx-sadman commented 3 years ago

So...
I see only two ways here: 1) You keep investigate this case by yourself for fun; 2) Someone other do investigations instead you for profit.

I can try do it. My email placed in the github profile.