charlie-haley / omada_exporter

Prometheus Exporter for TP-Link Omada Controller SDN.
MIT License
87 stars 14 forks source link

failed to login: unexpected end of JSON input #57

Closed markthebro closed 1 year ago

markthebro commented 1 year ago

Hi (again)

I've downloaded the omada-exporter for CLI and I'm note able to login to my Omada Hardware Controller I get all the time the error

pi@raspberrypi:/opt/omada-exporter $ ./omada-exporter
INFO[0000] not logged in, logging in with user: viewer
FATA[0000] failed to login: unexpected end of JSON input
pi@raspberrypi:/opt/omada-exporter $

My .profile looks like this

export OMADA_HOST='http://omada.local:8088'
export OMADA_USER='viewer'
export OMADA_PASS='viewer011'
export OMADA_INSECURE=true
export OMADA_PORT=9200

The login using the UI does work properly - I'm using a phyiscal Omada Controller. Current used firmware 2.6.1 Build 20220921 Rel.35903 - Controller Version 5.6.4

I'm very helpful for any tips....

Thanks in advance and best regards, Markus

charlie-haley commented 1 year ago

I believe the OC200 enforces a HTTPS redirect by default, could you try changing OMADA_HOST to https://? (Unless you've disabled this in the controller settings)

markthebro commented 1 year ago

Great - that was the issue! Many thanks!