Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[database::influxdb::plugin] Is InfluxDB v2 supported? #5037

Open
Aleksey-Maksimov opened this issue May 22, 2024 · 7 comments
Open

[database::influxdb::plugin] Is InfluxDB v2 supported? #5037

Aleksey-Maksimov opened this issue May 22, 2024 · 7 comments
Labels

Comments

@Aleksey-Maksimov
Copy link

Hello.
Is InfluxDB v2 supported in the plugin "database::influxdb::plugin" ?

# ./centreon_plugins.pl --plugin=database::influxdb::plugin --mode=list-databases 
--hostname localhost --username 'admin' --password 'mypass' --debug

UNKNOWN: 401 Unauthorized

URL: 'http://localhost:8086/query?epoch=s'
Parameters: 'q=SHOW DATABASES'
======> request send
POST http://localhost:8086/query?epoch=s
Authorization: Basic aWNpbm....==
User-Agent: centreon::plugins::backend::http::useragent
Content-Type: application/x-www-form-urlencoded

q=SHOW+DATABASES
======> response done
HTTP/1.1 401 Unauthorized
Date: Wed, 22 May 2024 20:41:31 GMT
Content-Length: 48
Content-Type: application/json; charset=utf-8
Client-Date: Wed, 22 May 2024 20:41:31 GMT
Client-Peer: 127.0.0.1:8086
Client-Response-Num: 1
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.7.6
X-Platform-Error-Code: unauthorized

{"code":"unauthorized","message":"Unauthorized"}
@lucie-dubrunfaut
Copy link
Contributor

Hello :)

Were you able to verify via a curl command that you were able to authenticate? Were you able to verify that you were able to query the path: http://localhost:8086/query?epoch=s?

@Aleksey-Maksimov
Copy link
Author

I think username and password are not enough for InfluxDB v2. As far as I understand, it uses an access token to connect to the InfluxDB v2 API, but "database::influxdb::plugin" does not have options to pass the token.

@lucie-dubrunfaut
Copy link
Contributor

Ok if I well understand the api.pm custom mode needs an update with a token handling to ensure compatibility with InfluxDB v2? If so, can you provide us the API doc/endpoint that would ensure authentication with a token rather than a combination of username and password?

@Aleksey-Maksimov
Copy link
Author

Official API documentation here https://docs.influxdata.com/influxdb/v2/api/

@lucie-dubrunfaut
Copy link
Contributor

Hello :)

First thanks for the documentation link. And to facilitate the addition of token authentication in the plugin, can you provide us the curl commands and JSON returns which may allow us to simulate your connection environment (and why not test list-database mode)?

@Aleksey-Maksimov
Copy link
Author

I don't understand what "curl commands" you are talking about.

@lucie-dubrunfaut
Copy link
Contributor

I think I found what I was looking for in the TokenAuthentication section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants