charlie-haley / omada_exporter

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

Error when using omada_exporter with a software controler and 3 AP #48

Closed Oupsman closed 2 years ago

Oupsman commented 2 years ago

Hello,

I'm trying to setup this software, but when I run it with the required parameters, I get this error message :+1: docker run -it -p 9202:9202 -e OMADA_HOST="https://1.1.1.1:8043" -e OMADA_USER=redacted -e OMADA_PASS=verylongandcomplicatedpassword -e OMADA_SITE="Default" -e OMADA_INSECURE="true" chhaley/omada_exporter panic: runtime error: slice bounds out of range [1:0]

goroutine 1 [running]: github.com/charlie-haley/omada_exporter/pkg/api.(Client).getCid(0xc0000dc400) github.com/charlie-haley/omada_exporter@v0.6.0/pkg/api/auth.go:66 +0x20a github.com/charlie-haley/omada_exporter/pkg/api.Configure(0xc0000dc3c0) github.com/charlie-haley/omada_exporter@v0.6.0/pkg/api/api.go:49 +0xb3 github.com/charlie-haley/omada_exporter/cmd.run(0xc0000ce000) github.com/charlie-haley/omada_exporter@v0.6.0/cmd/exporter.go:86 +0x119 github.com/urfave/cli/v2.(App).RunContext(0xc000082820, {0x99efa8, 0xc000026040}, {0xc00001e200, 0x1, 0x1}) github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x7a8 github.com/urfave/cli/v2.(*App).Run(...) github.com/urfave/cli/v2@v2.3.0/app.go:224 github.com/charlie-haley/omada_exporter/cmd.Run() github.com/charlie-haley/omada_exporter@v0.6.0/cmd/exporter.go:63 +0xaed main.main() github.com/charlie-haley/omada_exporter@v0.6.0/main.go:8 +0x17

And I don't know when to look to solve this error.

RaymondMouthaan commented 2 years ago

Not sure if it causes the issue, but OMADA_HOST="https://1.1.1.1:8043 doesn't look right to me.

Ip 1.1.1.1 is the cloud flare dns -> https://www.cloudflare.com/en-gb/learning/dns/what-is-1.1.1.1/

The IP address of your Omada controller can't have the same IP address to avoid possible conflicts.

Oupsman commented 2 years ago

Of course, the real IP is not given here and everything is scrambled.

charlie-haley commented 2 years ago

Hi @Oupsman, thanks for raising this, what version of the omada controller are you running?

Oupsman commented 2 years ago

I'm using the software controler version 3.2.14.

charlie-haley commented 2 years ago

I'm using the software controler version 3.2.14.

Currently the exporter isn't backwards compatible, I'd highly recommend updating your controller software to at the very minimum 4.x.x. Going forward, I'll most likely be supporting version 4.x.x+ for backwards compatibility

I've also created a ticket to document the exporter compatibility in the readme

charlie-haley commented 2 years ago

Closing, feel free to re-open if upgrading still doesn't solve your issue