I am trying to collect information from MongoDB using telegraf to output it to influxdb.
I tried multiples configuration each one giving me different errors.
[[inputs.mongodb]] servers = ["mongodb://<user>:<password>@mongodb"] gather_perdb_stats = false insecure_skip_verify = false [inputs.mongodb.ssl] enabled = true cacerts = [""" -----BEGIN CERTIFICATE----- <my_cert> -----END CERTIFICATE----- """]
Using insecure_skip_verify with true/false doesn’t make any change.
Changing the certs changes what it does…
Normally with a cert and connection errors on telegraf on MongoDB it gives me
E NETWORK [conn1707] no SSL certificate provided by peer; connection rejected
And the only time that seems that the certificate is transmitted to the server it gives me the error
error in Dial, x509: certificate signed by unknown authority
this certificate works just fine using the mongo cli tool.
And there’s time that the telegraf gives me errors that it couldn’t parse the root certificate.
E! Error in plugin [inputs.mongodb]: failed to parse root certificate
I’m using the docker image (1.6.0 - alpine) and running it on k8 as a daemonset.
It works if I disable SSL on MongoDB.