Page 2 of 2

Re: mongo Data Base Data Monitoring

Posted: Sun Jan 13, 2019 5:20 am
by bashar.abed
Hi,

i used this command and used username and password that used for connect to the mongodb using the client but we got error that the username and password are incorrect as shown below:

[root@nms libexec]# ./check_mongodb.py -H 10.*.*.* -P 27017 -u **** -p ***** -d local -q 'db.statistics.find()'
Username/Password incorrect
[root@nms libexec]#

so could you please check and advice about it, do I need to use the linux server credentials on the command or the DB username and password like what I did.

Also what the output I expect to got, the (db.statistics.find()) or something else.

Thanks

Re: mongo Data Base Data Monitoring

Posted: Mon Jan 14, 2019 11:26 am
by lmiltchev
i used this command and used username and password that used for connect to the mongodb using the client but we got error that the username and password are incorrect as shown below:

[root@nms libexec]# ./check_mongodb.py -H 10.*.*.* -P 27017 -u **** -p ***** -d local -q 'db.statistics.find()'
Username/Password incorrect
Check with your db admin to make sure you are using the correct credentials. Are there any special characters in the password? Try wrapping the password in single quotes. Does this help?
so could you please check and advice about it, do I need to use the linux server credentials on the command or the DB username and password like what I did.
You need to be using the DB username and password as you did.
Also what the output I expect to got, the (db.statistics.find()) or something else.
To be honest with you, I don't know a lot about mongo DB. I set up a "test" db just to try the plugin. I logged into my test mongo db box, did an insert, then logged into Nagios XI, and tested the plugin.
example01.PNG
example02.PNG

Re: mongo Data Base Data Monitoring

Posted: Thu Jan 17, 2019 2:44 am
by bashar.abed
hi;

hope this mail find you well,

Please note that I used the same credentials that used to login and do the needed queries on the mongodb, and its working fine and as expected, so I don't know why we got the below incorrect credentials while its correct, so could you please check the script/plugin itself, maybe it have a problem or needed another credentials different that we're using and add, so your kind help and advice is appreciated.

Thanks

Re: mongo Data Base Data Monitoring

Posted: Thu Jan 17, 2019 11:48 am
by lmiltchev
Are there any special characters in the password? Try wrapping the password in single quotes. Does this help?

Re: mongo Data Base Data Monitoring

Posted: Sun Jan 20, 2019 3:02 am
by bashar.abed
Hi,

please note that there is no any special character in the password and we tried to add the password in a single quotation and the same error we got, so please we need to find the issue and the problem, I think there is an issue with he script/plugin itself, can we double check it and make sure from it.


[root@nms libexec]# ./check_mongodb.py -u ad** -p 't**t' -H 10.*.*.* -d local -q 'db.statistics.find()' -W 50 -C 60
Username/Password incorrect
[root@nms libexec]#

Thanks

Re: mongo Data Base Data Monitoring

Posted: Mon Jan 21, 2019 11:13 am
by lmiltchev
The problem may be caused by the authentication method in use - MONGODB-CR vs CRAM-CHA.

https://docs.mongodb.com/manual/core/se ... tion-scram

Perhaps, this is a limitation of the plugin. Do you know what is the authentication method that you are currently using? Can you log into the mongodb box, run the following command, and show the output?

Code: Select all

db.system.version.find()
Here's the output on my test mongodb box:
example01.PNG
Have you tried contacting the plugin's owner? This is a 3rd party plugin, not written or maintained by us.

Check the possible solutions, listed here:
https://stackoverflow.com/questions/290 ... ion-failed