zbx-sadman / unifi_proxy

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

Zabbix 3.0 #6

Closed gorankav closed 7 years ago

gorankav commented 8 years ago

Trying to use it with Zabbix 3.0 & Unifi 4.8.15

Some requests return valid data, some return an empty string. (checking the zabbix_agent.log)

I've tried to extend the timeout in zabbix_agent.conf and when calling nc(added -w 3). But did not helped.

The responses require a rather long time (when not cached): between 2 and 3 sec.

What to check?

zbx-sadman commented 8 years ago

Can you show the example of request?

Empty string must be returned in two cases:

1) JSON-key, that found in UniFi Controller's reply contain no data (JSON:Null). I know one key at least - UAP - stat.ng_ast_txto. 2) Group (aggregate) function applied to empty array of objects. It's may be average UAP's RSSI calculating with no users online. RSSI is users property, but its may used to determine how good UAP placed,

For the first case, compare Miner/Proxy output with JSON-key value, that can be found in cache files (/dev/shm).

For the second case you can replace empty output by relevant value. For _"[apmac={#MAC}].signal" it can be -100 (dbm), for example. See template, UAP discovery rule - _unifi.proxy[median,user,{#SITENAME},"[apmac={#MAC}].signal",,-100].

Connecting to UniFi Controller always is long (try to speed up LWP ;) and no-cached requests must be used only for debug or force renew data in several scenarios with sequential request (RRD databases update, for example).

alexandreheidemann0 commented 7 years ago

Hello

Has anyone tested with Unifi Controller 5.x yet? I could not return some values, such as users per ap.

Thank you

zbx-sadman commented 7 years ago

How you try to get metric? Show the example of request. Do you can't get users number on one AP or on all APs?

alexandreheidemann0 commented 7 years ago

Hello

I have approximately 140 unifi on 14 different site. I'm analyzing more calmly, I have several items that are "not unsupported". I believe that the Unifi Controller server is not responding to so many requests. He has more than 8000 items on Zabbix.

I will remove some items that are not in my interest from the template in order to decrease this value. And I'll keep track of which ones will be outstanding.

Thank you!

zbx-sadman commented 7 years ago

I think that is not controller problem. Bottleneck may be in UserParameter, if you use it.

140APs is big installation for me and i'm interested in the statistics of the Proxy works. Can you write to me on email? Tanx.

zbx-sadman commented 7 years ago

Solved.

The user has engaged UniFi Miner instead UniFi Proxy to~140APs monitoring.