zbx-sadman / unifi_proxy

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

"Number of all UAPs on site" item is always zero #25

Closed troffasky closed 6 years ago

troffasky commented 6 years ago

Zabbix agent/server 3.4.7 unifi_proxy 1.3.5 Template "Template UBNT UniFi Controller v5 - active checks" Unifi server 5.6.11

Have this mostly working - can see throughput graphs etc in Zabbix.

However, the item "Template UBNT UniFi Controller v5 - active checks: [{#DESC}] Number of all UAPs on site | unifi.proxy[get,site,{#NAME},num_ap,,0]" is somehow always zero. Calculated items that subtract something from num_ap then end up disabled because the answer goes negative.

I have tested on the Unifi server with:

unifi_proxy_get 127.0.0.1 8448 get,site,sitename,num_ap,,0

and that always returns zero, regardless of how many APs are actually configured in that site.

zbx-sadman commented 6 years ago

Yes, i know - UBNT moved this key to "health" object...

I'm going to remake the template soon. Until that time you can use "get,health,default,num_ap" (only active APs) or "get,uap,default,items_num" (all APs, unactive ones counts too) queryes.

troffasky commented 6 years ago

Thanks for your work on this tool, it's an excellent addition.

May I respectfully suggest that if you are working on the templates, that you look at the default item intervals? My experience was that 60s for many of the items is unnecessarily aggressive. Normally I wouldn't complain about this but there is no Mass Update option for LLD prototype items!

zbx-sadman commented 6 years ago

Every time I see these intervals, I begin to argue with myself about them.

My strategy is: 60 sec only for important metrics.

You can don't worry about system load when you use UniFi Proxy + loadable module - all data is cached and when you take some metrics from one object - only first query initiate connect to UniFi controller and take data. All next queryes will taken from cache and this process spend less a second of time. But you have profit - all data is taken from the same time interval.

And i know how it's hard - changing prototype settings. I did it many hundred times when edit the templates.