Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..
788 views

MongoDB User permissions required for perMongoDB Collector aspect

HI

I have applied the MongoDB MP in the following link:

https://marketplace.microfocus.com/itom/content/omi-management-pack-mongodb

But I ahve query related to MongoDB Collector aspect, there are required parameters In the documentation MongoDB User Name, MongoDB Password and MongoDB Authentication Database. this part isn’t clear and just mentioned that MongoDB these parameters are required.

Could you clarify the permissions are needed for this user ? MongoDB team needs to know which types of permissions are needed in details for this user to create new one for monitoring purpose ?

Can any one help in that please ?

Thanks

0 Likes
16 Replies
Daniela_G Acclaimed Contributor.
Acclaimed Contributor.

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hello @Mohamed Azzam

Thank you for your post.

We have involved more resources in orde to provide you a feasible answer for your concern.

Thanks for your patience

Regards,

Daniela Gómez Alvarado
Customer Support Engineer

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.
0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Thanks @Daniela_G

After checking with MongoDB team about user authentication topic, they confirmed that there isn’t any authentication mechanism implemented in MongoDB environment and so I started to deploy MP policies and testing the result. The deployment did successfully, however, we aren’t able to get the metrics data on OMi performance dashboard. By checking the logs, some metrics are collected properly while the other metrics give No value defined for metric. So kindly we need your urgent support for this topic as we are stuck from a long time as we aren’t able to get proper support for this MP.

 

Your fast support is highly appreciated.

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hello @Mohamed Azzam,

To monitor MongoDB MP, user needs “readAnyDatabase” permission. Please find the example steps to create a user with “readAnyDatabase” permission below.

 

Example: Run the below commands in MongoDB shell.

use admin

db.createUser(

  {

    user: "readonly",

    pwd: "iso*help",

    roles: [ { role: "readAnyDatabase", db: "admin" } ]

  }

)

 

 

MongoDB Collector aspect requires following parameters.

MongoDB User Name: <Enter Above created USERNAME>

MongoDB Password: < Enter Password>

Database holds User Credentials: < Enter DB Name to which this user belongs to>

 

Example: I am just showing example data for the above created user.

MongoDB User Name: readonly

MongoDB Password: iso*help

Database holds User Credentials: admin

Please let me know if you still have any questions.

 

 

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar,

Thanks a lot for the reply, but as I mentioned before there isn’t any authentication mechanism implemented in MongoDB environment and so I started to deploy MP policies and testing the result.

The deployment did successfully, however, we aren’t able to get the metrics data on OMi performance dashboard. By checking the logs, some metrics are collected properly while the other metrics give No value defined for metric.

Could the lake of authentication cause the polices can't collect the metrics? if not, could you please suggest how we can detect where is the issue and how can we fix it to enable MP polices to collect the required metrics?

Thanks in advance.

Mohamed Azzam

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hello @Mohamed Azzam,

Mongo DB works fine without any credentials but if credentials are configured then please follow the steps mentioned in my previous message.

Also can you please share the following details in a text file

1)  ovcodautil -ds MONGODB -o MONGODB_DATABASE -flat

2) mongostat

Thanks & Regards,

Diwakar.

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar

Kindly check attached the ovcodautil output file. I can't get any output by running command mongostat on the server, if there is full path required to add before the command or we can use it any location?

 

Thanks

Mohamed Azzam

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Mohamed Azzam,

MongoDB MP Collection depends on mongostat command as it is not working in your setup hence collection is not happening.

Please ensure that mongostat command is workign as expected. Normally it will be available in the below path.

[root@iwfvm07607 ~]# which mongostat
/usr/bin/mongostat

Example Output:

[root@iwfvm07607 ~]# mongostat
insert query update delete getmore command % dirty % used flushes  vsize   res qr|qw ar|aw netIn netOut conn                      time
    *0    *0     *0     *0       0     1|0     0.0    0.0       0 455.0M 74.0M   0|0   0|0   79b    18k    1 2018-05-10T00:18:50-04:00
    *0    *0     *0     *0       0     1|0     0.0    0.0       0 455.0M 74.0M   0|0   0|0   79b    18k    1 2018-05-10T00:18:51-04:00

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar

mongostat command isn't getting me any output when I try to run this command by using ovdeploy command as below:

/opt/OV/bin/ovdeploy -cmd "mongostat" -host TFSTRU23L -ovrg server

When I connected ssh to the server and run the command  mongostat, the command is working as expected and give the below output:

gwce@tfstru23l ~ $ mongostat
connected to: 127.0.0.1
insert  query update delete getmore command flushes mapped  vsize    res faults    locked db idx miss %     qr|qw                                            ar|aw  netIn netOut  conn     set repl       time
    *0     *0     *0     *0       0     1|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0                                              0|0    62b     3k   124 telflow  SEC   21:31:27
    *0     *0     *0     *0       0     3|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0                                              0|0   338b     4k   124 telflow  SEC   21:31:28
    *0     *0     *0     *0       0     7|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0                                              0|0   404b     6k   124 telflow  SEC   21:31:29
    *0     *0     *0     *0       0     5|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0                                              0|0   452b     4k   124 telflow  SEC   21:31:30
    *0     *0     *0     *0       0     2|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0     0|0   120b     4k   124 telflow  SEC   21:31:31
    *0     *0     *0     *0       0     5|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0     0|0   452b     4k   124 telflow  SEC   21:31:32
    *0     *0     *0     *0       0     8|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0     0|0   463b     6k   124 telflow  SEC   21:31:33
    *0     *0     *0     *0       0     9|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0     0|0   683b     6k   124 telflow  SEC   21:31:34
    *0     *0     *0     *0       0     2|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0     0|0   200b     4k   124 telflow  SEC   21:31:35
    *0     *0     *0     *0       0     2|0       0  6.39g  13.6g    77m      0 tf_rest:0.0%          0       0|0     0|0   200b     4k   124 telflow  SEC   21:31:36

So mongostat command is working fine on the server, could you please check above output and advice for next actions to be done?


Thanks
Mohamed Azzam

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar

Could you please check my previous reply and advice for next actions ?

 

Thanks

Mohamed Azzam

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar

Appreciate to check my reply and feedback.

Thanks in advance.

 

Mohamed Azzam

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hello @Mohamed Azzam,

I see there is a difference in the mongostat command output columns. That's the reason Data Collection is not happening for all metrics. Please check the formats below.


Expected Format: insert query update delete getmore command % dirty % used flushes  vsize   res qr|qw ar|aw netIn netOut conn                      time
Actual Format( In your System): insert query update delete getmore command flushes mapped  vsize    res faults    locked db idx miss %     qr|qw    ar|aw  netIn netOut  conn     set repl       time

As per mongodb doc, mongostat output should be in the expected format. I am not sure about why it is different in your system. Can you please share me the inside info for that.

I have attached a screenshot and you can find more details about mongostat command in the below link..


https://docs.mongodb.com/manual/reference/program/mongostat/

Collection will work fine if mongostat output is in expected format.


I am here by attaching my mongostat version and output.

 

Also can you please share the output of the following command.

/var/opt/OV/bin/instrumentation/monitorframeworkperl monitorframework.pl -developer -topology MongoDBCollector.pmMongostatLink.JPGMongoStat-Ver.JPG

 

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar

I think the format difference is coming from a mongostat different version between our system and yours. Kindly check attached screenshot for required information.

 

Thanks

Mohamed Azzam

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hello @Mohamed Azzam,

Looks like you are using old version of mongostat. Is it possible for you to upgrade the mongostat.

Also you are getting an error while running the following command. Is Agent installed on this system. If so can you please cross check the path.

ex: You can try this command

export PATH=$PATH:/usr/sbin:/usr/bin:/opt/OV/bin:/opt/OV/bin/OpC/install:/var/opt/OV/bin/instrumentation/:/opt/perf/bin/

0 Likes
Valued Contributor.. Mohamed Azzam Valued Contributor..
Valued Contributor..

Re: MongoDB User permissions required for perMongoDB Collector aspect

Hi @Lakshmi Diwakar

I will check with MongoDB team if that possible to upgrade mongostat version or not. Could please share which version will be exactly required to enable management pack to collect metrics?

If the upgrade isn't possible is that means we will not be able to get the MP working ? do we have any other workaround if the upgrade can't be done?

The agent is installed and it's up and running, after adding the export PATH, the command is working give the following output:

gwce@tfstru23l ~ $ export PATH=$PATH:/usr/sbin:/usr/bin:/opt/OV/bin:/opt/OV/bin/OpC/install:/var/opt/OV/bin/instrumentation/:/opt/perf/bin/
gwce@tfstru23l ~ $ /var/opt/OV/bin/instrumentation/monitorframeworkperl monitorframework.pl -developer -topology MongoDBCollector.pm
================================
print() on closed filehandle $LOGFILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1753.
Starting monitoring, using version 01.05.000, perl 5.016000, Agent: 12.03, Interval: all, Loglevel: 1
print() on closed filehandle $LOGFILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1753.
Template Directory: /var/opt/OV/datafiles/policies/configfiletmpl
Policy Directory:   /var/opt/OV/datafiles/policies/configfile
readline() on closed filehandle CONFIG at /var/opt/OV/bin/instrumentation/monitorframework.pl line 390.
readline() on closed filehandle FILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1428.
Use of uninitialized value $module in concatenation (.) or string at /var/opt/OV/bin/instrumentation/monitorframework.pl line 438.
: policy is disabled, skipping
print() on closed filehandle $LOGFILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1753.
readline() on closed filehandle CONFIG at /var/opt/OV/bin/instrumentation/monitorframework.pl line 390.
readline() on closed filehandle FILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1428.
Use of uninitialized value $module in concatenation (.) or string at /var/opt/OV/bin/instrumentation/monitorframework.pl line 438.
: policy is disabled, skipping
print() on closed filehandle $LOGFILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1753.
readline() on closed filehandle CONFIG at /var/opt/OV/bin/instrumentation/monitorframework.pl line 390.
readline() on closed filehandle FILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1428.
Use of uninitialized value $module in concatenation (.) or string at /var/opt/OV/bin/instrumentation/monitorframework.pl line 438.
: policy is disabled, skipping
print() on closed filehandle $LOGFILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1753.


Topology collected:
<Service>

print() on closed filehandle $LOGFILE at /var/opt/OV/bin/instrumentation/monitorframework.pl line 1753.

 

Thanks

Mohamed Azzam

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.