mongo Data Base Data Monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bashar.abed
Posts: 153
Joined: Tue Oct 11, 2016 1:34 am
Location: Ramallah West Bank Palestine
Contact:

Re: mongo Data Base Data Monitoring

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: mongo Data Base Data Monitoring

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
bashar.abed
Posts: 153
Joined: Tue Oct 11, 2016 1:34 am
Location: Ramallah West Bank Palestine
Contact:

Re: mongo Data Base Data Monitoring

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: mongo Data Base Data Monitoring

Post by lmiltchev »

Are there any special characters in the password? Try wrapping the password in single quotes. Does this help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
bashar.abed
Posts: 153
Joined: Tue Oct 11, 2016 1:34 am
Location: Ramallah West Bank Palestine
Contact:

Re: mongo Data Base Data Monitoring

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: mongo Data Base Data Monitoring

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked