zbx-sadman / unifi_proxy

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

Value should be a JSON object #31

Closed reginfo closed 5 years ago

reginfo commented 5 years ago

Unifi Proxy 1.3.7 LLD unifi.proxy[discovery,uap,,vap_table] is getting Error : "Value should be a JSON object".

INVALID JSON (RFC 4627) Validator Output Error:Strings should be wrapped in double quotes.[Code 17, Structure 10070] Error:Expecting closing } at end[Code 22, Structure 10070] Error:Expecting closing ] at end[Code 22, Structure 10070] Error:Expecting closing } at end[Code 22, Structure 10070]

Execution zabbix_get command, I`ve receive this end of script

"{#ID}":"5a965d0de4b06de808c4dad2","{#SITENAME}":"default","{#SITE

If I execute zabbix_get -s 127.0.0.1 -k unifi.proxy[discovery,uap] I receive : "{#ID}":"5a4e1a68e4b001a8cb53efb0"}]}

zbx-sadman commented 5 years ago

Hello

I see no problem on my host

# zabbix_get -s 172.16.xxx.xxx -k unifi.proxy[discovery,uap,,vap_table]
{"data":[{"{#UAPMAC}":"00:27:22:d4:73:83","{#SITEID}":"5523f87e99320d293df816fd","{#ESSID}":"Airnet One","{#UP}":"1","{#STATE}":"RUN","{#SITEDESC}":"Default"....}]}
# zabbix_get -s 172.16.xxx.xxx -k unifi.proxy[discovery,uap]
{"data":[{"{#SITEID}":"5523f87e99320d293df816fd","{#STATE}":"1","{#SITEDESC}":"Default","{#IP}":"172.16.100.9","{#SITENAME}":"default", ... }]}
reginfo commented 5 years ago

Discovery UAP works correctly. Only sometimes I receive this error from zabbix_server.log:

2311:20190515:125016.995 discovery rule "Unifi-ZBX:unifi.proxy[discovery,uap]" became not supported: Value should be a JSON object. 2313:20190515:131018.604 discovery rule "Unifi-ZBX:unifi.proxy[discovery,uap]" became supported

But about discovery,uap,,vap_table, can this problem be related with a lot of data?

zbx-sadman commented 5 years ago

Yes, output will be shrinked if data length is more than 64k (One of Zabbix's limit for incoming data).

reginfo commented 5 years ago

Hmm, maybe. I`ve added one more unifi_proxy where only 40 APs and there is also some errors over time:

zbx:unifi.proxy[discovery,uap,,vap_table]" became not supported: Value should be a JSON object. zbx:unifi.proxy[discovery,uap,,vap_table]" became supported

zbx-sadman commented 5 years ago

So, i have ideas about JSON fix .

Some tests must be performed, but i have no access to controller on middle- and big-size UniFi networks at least to be done it.

zbx-sadman commented 5 years ago

And one more question, not related to these thread. Do you have UAP device state values? Just now one is having value of 10 and no trigger worked. So wondering to get all picture.

image

reginfo commented 5 years ago

Yes, found it after posting it. :D

reginfo commented 5 years ago

So, i have ideas about JSON fix .

It`s good news.

zbx-sadman commented 5 years ago

So, i have ideas about JSON fix .

It`s good news.

May be good, may be not, No tests - no fix. My UniFi network so small.

reginfo commented 5 years ago

I can try to help with tests!

zbx-sadman commented 5 years ago

Unfortunately, now i have no time for utility improvement & testing for free.

You can wait or paid for my work time.

zbx-sadman commented 5 years ago

So...

Try v1.3.8 from experimental. Use JsonOutput option and refer to '-j' command line option description in the UniFi Miner 1.3.0 Russian Guide

reginfo commented 5 years ago

Big Thanks!

Just installed. I will test it.

zbx-sadman commented 5 years ago

@reginfo It works?

zbx-sadman commented 5 years ago

No activity and feedback.

reginfo commented 5 years ago

Sorry for not answering. A lot of e-mails coming and not notice yours. Yes, this version works perfectly . My backend is almost clean, receive some times errors about incorrect values and some errors in discovery about dublicates. But I am very thankful to you.