[SERVER-13598] MongoDB plugins with Munin fail Created: 15/Apr/14  Updated: 30/Nov/14  Resolved: 30/Nov/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.4.9
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Ilya Medvetskiy Assignee: Bernie Hackett
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-3174 Docs for mongo-munin are incomplete Closed
Participants:

 Description   

Hello,

We've deployed Munin Server and nodes to improve MongoDB monitoring. installed mongo plugins from here: http://docs.mongodb.org/ecosystem/tools/munin/

Unfortunately mongo monitoring plugins fail with errors. I've made sure that python scripts (plugins) point to correct mongo port and host, but they always produce similar errors. Here is the error when running mongo_lock manually using python 2.6.6 and 3.4.0:

Python 2.6.6
Traceback (most recent call last):
File "mongo_lock", line 45, in <module>
doData()
File "mongo_lock", line 20, in doData
status = getServerStatus()
File "mongo_lock", line 15, in getServerStatus
return json.loads( raw )["serverStatus"]
File "/usr/lib64/python2.6/json/_init_.py", line 307, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.6/json/decoder.py", line 338, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Python 3.4.0
File "mongo_lock", line 25
print name + ".value " + str( 100 * ratio )
^
SyntaxError: invalid syntax

Are these plugins only compatible with specific version of python and/or MongoDB?
Any advise would be appreciated.



 Comments   
Comment by Bernie Hackett [ 15/Apr/14 ]

Good to hear. I've opened DOCS-3174 to get the documentation fixed. Let us know if you run into any more problems.

Comment by Ilya Medvetskiy [ 15/Apr/14 ]

That was it, rest interface had to be enabled and scripts point to it.
Would definitely help if wiki mentioned it.
Thank you Bernie.

Comment by Bernie Hackett [ 15/Apr/14 ]

Hi,

The mongo-munin plugin will only work with python 2.x. Python 2.6.6 should work fine, but Python 3.4 is incompatible.

I've made sure that python scripts (plugins) point to correct mongo port and host

What port did you use? This plugin pulls server status using the mongo rest interface, not the mongodb wire protocol. You will have to start your mongo instances with the --rest option. By default the rest interface runs on port number 1000 greater than the --port option for mongo, 28017 by default.

Generated at Thu Feb 08 03:32:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.