I am trying to deploy monitoring of our Mongodb environment and are strugling to get it working.
The following works, to login to the CLI:
This does not work:
I must use parameter --authenticationDatabase admin to succesfully login.
The templates i use to monitor, or at least try, do not support a authenticationDatabase.
Therefore, i cannot get information about the database and thus not monitor the internals.
Template versions are:
- 7.4-0 MongoDB cluster by Zabbix agent 2
- 7.4-0 MongoDB node by Zabbix agent 2
My Zabbix version is 7.4.2
I was thinking to pass a parameter for this in my mongodb.conf, zabbix_agent2 plugin, but do not know how to do this or if it is even possible.
Is there a workaround or another solution to this.
Thank you for your attention.
Input is greatly appreciated.
Regards, Peter.
The following works, to login to the CLI:
Code:
mongodb01:~# mongo -u zabbix_read -p zREDACTEDJ --authenticationDatabase admin MongoDB shell version v3.6.3 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.3 prodrs0:SECONDARY> quit
Code:
mongodb01:~# mongo -u zabbix_read -p zREDACTEDJ MongoDB shell version v3.6.3 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.3 2025-09-22T09:07:24.078+0200 E QUERY [thread1] Error: Authentication failed. : DB.prototype._authOrThrow@src/mongo/shell/db.js:1608:20 @(auth):6:1 @(auth):1:2 exception: login failed
The templates i use to monitor, or at least try, do not support a authenticationDatabase.
Therefore, i cannot get information about the database and thus not monitor the internals.
Template versions are:
- 7.4-0 MongoDB cluster by Zabbix agent 2
- 7.4-0 MongoDB node by Zabbix agent 2
My Zabbix version is 7.4.2
I was thinking to pass a parameter for this in my mongodb.conf, zabbix_agent2 plugin, but do not know how to do this or if it is even possible.
Code:
Plugins.MongoDB.Sessions.REDACTEDMongoDB.Uri=tcp://localhost:27017 Plugins.MongoDB.Sessions.REDACTEDMongoDB.User=admin/zabbix_read Plugins.MongoDB.Sessions.REDACTEDMongoDB.Password=zREDACTEDJ
Thank you for your attention.
Input is greatly appreciated.
Regards, Peter.
Comment