MongoDB metrics PMM monitoring

I’m setting up monitoring of MongoDB in PMm and after activating authentification the monitoring stopped working (except for Replication Lag). 
I have added the user acc to this link and the MongoDB logs say :
 [conn800] Successfully authenticated as principal mongodb_exporter on admin from client
but the PMM mongodb metrics logs says 
time=“2020-05-13T10:42:36+02:00” level=error msg=“Failed to get replSet status: command replSetGetStatus requires authentication” source="replset_status.go:264"time=“2020-05-13T10:42:36+02:00” level=error msg=“Failed to get oplog status: command find requires authentication” source="oplog_status.go:143"time=“2020-05-13T10:42:41+02:00” level=error msg=“Failed to get server status: command serverStatus requires authentication” source="server_status.go:234"What else is needed ?


Have you passed the user name and password in the value of the --uri option when adding the mongodb:metrics monitoring service in the pmm-admin add command?

Hi @adivinho
I used this command : sudo pmm-admin add mongodb --uri mongodb://mongodb_exporter:password@FQDN:27017/admin

Hi @Catoman,
Here is a solution that was found here
Set environment variable MONGODB_URL before starting the exporter:
export MONGODB_URL=mongodb://mongodb_exporter:password@FQDN:27017

Hi @adivinho,
Edit, i think i made an error in the process. Have removed my comment and will test more 

Thanks @adivinho, that solved the problem. The graphs are getting populated now  :slight_smile: