Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request for MongoDB Support #38

Closed
jacobamey opened this issue Jan 24, 2014 · 21 comments
Closed

Feature Request for MongoDB Support #38

jacobamey opened this issue Jan 24, 2014 · 21 comments
Assignees

Comments

@jacobamey
Copy link

Hi Jordi,

Any chance of getting some MongoDB monitoring support added to Monitorix?

More then willing to be a test dummy :-)

@jacobamey jacobamey reopened this Jan 24, 2014
@ghost ghost assigned mikaku Jan 26, 2014
@mikaku
Copy link
Owner

mikaku commented Jan 26, 2014

Hi Jacob, :)

Of course, I'm always opened to include new graphs. Most of times though I'm not familiarized with the services requested, like this one.

So I'd appreciate if you can provide information of how to collect MongoDB statistics and some description of which values are relevant to include in the graphs, and even how they are related each other. Just to make sure that the final graphs are made properly.

Please, let me know.
Thanks

@oliverbestmann
Copy link

I dont know much about Perl, but there are official mongodb-bindings for Perl to connect to a database: http://docs.mongodb.org/ecosystem/drivers/perl/

Nice to have would be the datasize/storageSize of a database or colelction (you can get them via dbStats-command [1] and the collStats-command [2].)

Also, if the user sets the profiling-level of the db to "1", the number of slow-queries per time would be nice to see [3].

The serverStatus-command [4] offers much more information about the database, like connections, number of queries, etc... This would be nice too!

Have a nice day, Oliver

[1] http://docs.mongodb.org/manual/reference/command/dbStats/
[2] http://docs.mongodb.org/manual/reference/command/collStats/
[3] http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/
[4] http://docs.mongodb.org/manual/reference/command/serverStatus/

@mikaku
Copy link
Owner

mikaku commented Feb 4, 2014

I'll take a look to it.
Thanks!

@jacobamey
Copy link
Author

Hi Jordi,

Sorry I've been away the past week. Ill talk to our resident MongoDB administrator to see what he would like to see and how he collects data now.

Thanks for giving it a try, the information above looks rather good as well.

Oh! just noticed, you got my name wrong :-) Its actually Jake. Its a common mix up from my email. the J is my first initial with the Amey being the last name.

@mikaku
Copy link
Owner

mikaku commented Feb 6, 2014

Jacob,

Any help from your MongoDB administrator will be also very appreciated!

And yes, you're right, I've misspelled completely your name. Sorry for that.
Now it's fixed. :)

@jacobamey
Copy link
Author

Sorry, hes currently working on a large project. However. He is attending Mongo world this year (Leaves next week i believe). I'm sure he will have many ideas as to how to gauge and monitor performance on Mongo. Since we use your tool pretty standard in our environment I'm sure he will want to get you something to work with. If you wish, we can close this request right now as it will still be awhile before we really have anything for you. Up to you.

@mikaku
Copy link
Owner

mikaku commented Jun 20, 2014

Jacob,

I understand, no problem at all. We can close this request and resume it when he has something interesting in mind. Perhaps even better discuss it by email directly.

I really appreciate your interest on this.
Thanks.

@mikaku mikaku closed this as completed Jun 20, 2014
@mikaku
Copy link
Owner

mikaku commented Jan 11, 2017

Hi,

I've been working on this in the past weeks and this is what I have right now:

mongodb

The new mongodb.pm module supports monitoring of unlimited number of MongoDB servers, either locally or remotely.

That module uses the command serverStatus to gather overall statistics of each MongoDB server. It collects the following information:

  • uptime (not plotted in graph, useful?)
  • Asserts (the sum of all of them)
  • backgroundFlushing
    • average_ms
    • last_ms
  • connections
    • current
    • totalCreated
  • dur (not plotted in graph, useful?)
    • commits
    • journaledMB
    • writeToDataFilesMB
  • extra_info (not plotted in graph, useful?)
    • heap_usage_bytes
    • page_faults
  • globalLock (not plotted in graph, useful?)
    • globalLock.currentQueue
    • globalLock.activeClients
  • network
    • bytesIn
    • bytesOut
    • numRequests
  • opcounters
    • insert
    • query
    • update
    • delete
    • getmore
    • command
  • metrics.document
    • deleted
    • inserted
    • returned
    • updated

That module is also able to monitor an unlimited number of databases per each MongoDB server. It uses the command dbStats to gather statistics of each one. It collects the following information:

  • collections
  • objects (not plotted in graph, useful?)
  • dataSize
  • storageSize
  • numExtents
  • indexes
  • fileSize

In the screen shot attached you can see the statistics of a very-low activity local MongoDB server, and the statistics of a database called Test1. If more databases are monitored they will appear stacked at the end.

Thoughts?

@mikaku mikaku reopened this Jan 11, 2017
mikaku added a commit that referenced this issue Jan 12, 2017
@mikaku
Copy link
Owner

mikaku commented Jan 13, 2017

This is done in 0fdc7f2.

@mikaku mikaku closed this as completed Jan 13, 2017
@aularon
Copy link

aularon commented Feb 13, 2017

Hello,
When will a new version that includes this be released?
Thanks!

@mikaku
Copy link
Owner

mikaku commented Feb 14, 2017

@aularon,

I have no specific schedule for every version, so I can't tell you when it will be released.
I'd like to include some new things in the current devel version before releasing it.

@riddhik84
Copy link

I configured Mongodb graph and when I open the url I am able to see the mongodb tables. However, I see no data in the graphs. Do I need to configure username, password of the db also on monitorix.conf file?

I have installed mongodb and monitorix on the same linux box.

Below the configuration:

list = localhost
max_db = 1


host = 127.0.0.1
db_list =


rigid = 0, 0, 0, 0, 0, 0, 0, 0
limit = 100, 100, 100, 100, 100, 100, 100, 100

@mikaku
Copy link
Owner

mikaku commented Aug 6, 2019

You should specify in the option db_list = the database name(s) that you want to monitor.

@riddhik84
Copy link

riddhik84 commented Aug 6, 2019

Yes I have specified it.
I changed it like below and then restarted service but does not work.

mongodb
list = localhost
max_db = 1
<desc
<localhost
host = IP address of the mongo db.. not 127.0.0.1
port = 27017
db_list = dbname
</localhost
</desc
rigid = 0, 0, 0, 0, 0, 0, 0, 0
limit = 100, 100, 100, 100, 100, 100, 100, 100
</mongodb

Where can I specify credentials like username and password to connect to mongodb?

@riddhik84
Copy link

I have removed the formatting because somehow it does not allow me to post with formatting

@riddhik84
Copy link

<mongodb>
	list = localhost
	max_db = 1
	<desc>
		<localhost>
			host = dbIP
			port = 27017
			db_list = dbname
		</localhost>
	</desc>
	rigid = 0, 0, 0, 0, 0, 0, 0, 0
	limit = 100, 100, 100, 100, 100, 100, 100, 100
</mongodb>

@mikaku
Copy link
Owner

mikaku commented Aug 6, 2019

I'm afraid the only options I implemented were host, port and db_list, I'm sorry.

I'll include in my ToDo list to add the options username and password, but you should create a new issue for this, and leave this issue closed as it is.

Meanwhile, and as workaround, I think you could hack the port option like this:

port = "27017  --username <username>  --password <secret>"

I hope that helped you.

@riddhik84
Copy link

<mongodb>
	list = localhost
	max_db = 1
	<desc>
		<localhost>
			host = dbIP (not 127.0.0.1)
			port = "27017 --username=username --password=password"
			db_list = dbname
		</localhost>
	</desc>
	rigid = 0, 0, 0, 0, 0, 0, 0, 0
	limit = 100, 100, 100, 100, 100, 100, 100, 100
</mongodb>

Updated like this in my conf file.. .. and will check if that works.

Also I will raise another issue for this.

@mikaku
Copy link
Owner

mikaku commented Aug 6, 2019

Updated like this in my conf file.. .. and will check if that works.

OK, just let me know.

Also I will raise another issue for this.

Perfect! 👍

@riddhik84
Copy link

I went thru all the stats in serverStatus output of MongoDB. I find below also useful in graph if possible:

**globalLock (not plotted in graph, useful?)**
globalLock.currentQueue
globalLock.activeClients

Can I raise separate issue for that?

@mikaku
Copy link
Owner

mikaku commented Aug 7, 2019

Can I raise separate issue for that?

Yes, of course, but please be as much detailed as possible on how to gather this statistic value.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants