Closed hudecof closed 6 years ago
Hello Peter.
You can disable cache feature for some tests - just use "... -с 0" option for unifi_miner.pl and it will be connect to UniFi Controller every time to get JSON. If you find no errors, use "... -d 3 > log,txt" option for looking to cache reading results. Value '3' will generate a few log lines, but can be very helpfull.
So... if you use unifi_miner.pl via UserScript, may be you need to increase Agent's Timeout value.
Debug mode for the unifi_miner.pl
shows
[17978] 2018-05-14 18:23:17 [.] Going over all sites
[17978] 2018-05-14 18:23:17 [.] Handle site: 'default'
[17978] 2018-05-14 18:23:17 [+] fetchData() started
[17978] 2018-05-14 18:23:17 [>] args: object type: 'wlan'
[17978] 2018-05-14 18:23:17 [.] Object path: 'https://127.0.0.1:8443/api/s/default/rest/wlanconf'
[17978] 2018-05-14 18:23:17 [.] No read/update cache because CacheMaxAge = 0
[17978] 2018-05-14 18:23:17 [+] fetchDataFromController() started
[17978] 2018-05-14 18:23:17 [>] args: object path: 'https://127.0.0.1:8443/api/s/default/rest/wlanconf'
[17978] 2018-05-14 18:23:17 [!] Comminication error: '403 Forbidden'
The log form the unify controller
[2018-05-14 18:25:27,844] <webapi-93> INFO event - [event] Admin[zabbix] log in from 127.0.0.1
[2018-05-14 18:25:28,757] <webapi-84> INFO api - [api] api.err.NoPermission: /api/s/super/get/setting
[2018-05-14 18:25:28,807] <webapi-92> INFO api - [api] api.err.NoPermission: /api/s/super/get/setting
[2018-05-14 18:25:28,857] <webapi-39> INFO api - [api] api.err.NoPermission: /api/s/super/get/setting
But for time to time it worksand I could retrieve full data set.
my monitoring user is read-only with Allow read only access to all sites permission
Peter, try to use UniFi admin account for API access just for test.
works as expected, I was not able reproduce the issue. I chage the role to SuperAdmin role
Okay...
I did not install v5.7.23 and do not know how works "Allow read only access to all sites" option. On old releases of UniFi Controller i had to add readonly user with name stat to every site (with the same password) to avoid "403 forbidden" error.
hi,
I'm experiencing following problem, both with unifi_miner.pl and unify_proxy.pl.
I run 3 times the same command and the respnse is
I suppose the problem is on the contorller side or some caching problem with the perl.
CONTROLLER VERSION: 5.7.23