Git Product home page Git Product logo

motop's Introduction

Motop

Realtime monitoring tool for several MongoDB servers. Shows current operations ordered by durations every second.

Usage

Install with easy_install:

easy_install motop

Install with pip:

pip install git+https://github.com/tart/motop.git

Download and install:

./setup.py install

Help:

motop -h

Monitor several servers:

motop 192.168.124.50 192.158.124.51

Actions

q Quit

p Pause

e Explain the query

k Kill operation using "mongo" executable

K Kill operations older than given seconds using "mongo" executable

r Try to reconnect to disconnected servers

R Try to reconnect to all servers

Dependencies

  • python 2.6 or greater
  • pymongo 2.0 or greater [1]

[1] http://pypi.python.org/pypi/pymongo/

Configuration (Optional)

Configuration file can be created to /etc/motop.conf.

There can be multiple sections on the configuration. Each section can include these parameters:

address
Address of the server (required)
username
Username to authenticate to the server
password
Password to authenticate to the server
status
Show status (default: on)
replicationInfo
Show replication status (default: on)
replicaSet
Show replica set status (default: on)
operations
Show operations (default: on)
replicationOperations
Show constantly appeared replication operations on the masters and the slaves (default: on)

"DEFAULT" is the special section. Parameters can be set as default in this section.

The names of the sections will be used as server names. These names can alse be used on arguments of the executable.

Example configuration:

[MongoDB01]
address=10.42.2.121
replicationOperations=off

[MongoDB02]
address=10.42.2.122

[MongoDB03]
address=10.42.2.123

[MongoDB04]
address=10.42.2.124
username=foo
password=bar

License

This tool is released under the ISC License, whose text is included to the source files. The ISC License is registered with and approved by the Open Source Initiative [1].

[1] http://opensource.org/licenses/isc-license.txt

Changelog

Motop 3.0

  • Change coding style according to the PEP 8 for more contribution
  • Improve human readable values
  • Fix replica set monitoring (UdjinM6)

Motop 3.1

  • Avoid crash for operations with missing fields
  • Avoid crash for failed explain, kill actions
  • Rename column State of the operation block
  • Show locks with operations

Motop 4.0

  • Avoid crash on missing data from server
  • Aviod crash on connection failures
  • Add reconnect buttons
  • Try to reconnect to disconnected servers after every 20 refreshes
  • Use username, password from the configuration instead of from the arguments

Motop 4.1

  • Avoid crash on replica set view

Motop 4.2

  • Support installation with pip

motop's People

Contributors

bradwhittington avatar hasegeli avatar leventyalcin avatar tanaydin avatar xupeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

motop's Issues

Crash when attempting to explain query

Server           Opid     Client           Type   Sec   Locks                          Namespace                      Query
localhost:27017  8364     127.0.0.1:41645  query  7                                    stockbase-prod.content         {"sort": [["pubDate", -1], ["title", 1]], "spec": {"$or"


Server: localhost:27017
Opid: 8364
Sort: pubDate: -1, title: 1
Spec: {
    "$or": [
        {
            "cik": "0000055135"
        },
        {
            "companyId": "FT6ya7JvZzoL9hiNW"
        },
        {
            "companies.stockbase.matched._id": "FT6ya7JvZzoL9hiNW"
        },
        {
            "companies.calais.matched._id": "FT6ya7JvZzoL9hiNW"
        },
        {
            "companies.alchemy.matched._id": "FT6ya7JvZzoL9hiNW"
        }
    ],
    "pubDate": {
        "$gt": {
            "$date": -2206281600000
        }
    }
}
Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in <module>
    pkg_resources.run_script('motop==4.1', 'motop')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/EGG-INFO/scripts/motop", line 4, in <module>
    motop.run()
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/motop.py", line 95, in run
    queryScreen.action()
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/queryscreen.py", line 324, in action
    if not self.__operationBlock.explainQuery(*inputValues):
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/queryscreen.py", line 272, in explainQuery
    return query.printExplain(line[0], line[6])
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/queryscreen.py", line 184, in printExplain
    explainOutput = server.explainQuery(ns, self.__parts)
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/server.py", line 126, in explainQuery
    return self.__execute(cursor.explain)
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/server.py", line 64, in __execute
    return procedure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 813, in explain
    return c.next()
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 1038, in next
    if len(self.__data) or self._refresh():
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 982, in _refresh
    self.__uuid_subtype))
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 925, in __send_message
    self.__compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/helpers.py", line 117, in _unpack_response
    compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 533, in decode_all
    tz_aware, uuid_subtype, compile_re))
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 159, in _get_object
    encoded, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 170, in _get_array
    as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 159, in _get_object
    encoded, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 170, in _get_array
    as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 159, in _get_object
    encoded, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 234, in _get_date
    dt = EPOCH_NAIVE + datetime.timedelta(seconds=seconds)
bson.errors.InvalidBSON: normalized days too large to fit in a C int

error on replset

when I connect to a secondary server of a replset,
error ocurs:

Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in 
    pkg_resources.run_script('motop==4.0', 'motop')
  File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
  File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1214, in run_script
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/EGG-INFO/scripts/motop", line 4, in 
    import pkg_resources
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/motop.py", line 95, in run
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/queryscreen.py", line 308, in action
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/queryscreen.py", line 130, in reset
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/server.py", line 103, in replicaSetMembers
NameError: global name 'values' is not defined

when I connect to a master server of a replset,
error ocurs:

Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in 
    pkg_resources.run_script('motop==4.0', 'motop')
  File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
  File "/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1214, in run_script
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/EGG-INFO/scripts/motop", line 4, in 
    import pkg_resources
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/motop.py", line 95, in run
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/queryscreen.py", line 308, in action
  File "/usr/local/lib/python2.7/site-packages/motop-4.0-py2.7.egg/libmotop/queryscreen.py", line 100, in reset
AttributeError: 'NoneType' object has no attribute 'as_datetime'

optimeData KeyError

Hello!

I just read about motop on the mongodb website and wanted to give it a try.

When trying to connect to an internal VM running MongoDB on a non-standard port such as hostname:27108, I get the error below. Not sure if the setup is the reason why it's failing or perhaps a newer version of Pymongo?

me@local ~/g/m/motop> python motop.py
Traceback (most recent call last):
  File "motop.py", line 578, in <module>
    queryScreen.action ()
  File "motop.py", line 558, in action
    self.__refresh ()
  File "motop.py", line 522, in __refresh
    ReplicaSetMember.block.reset ([member for replicaSet in self.__replicaSets () if str for member in replicaSet.members ()])
  File "motop.py", line 513, in __replicaSets
    add (server.replicaSet ())
  File "motop.py", line 340, in replicaSet
    lag = replicaSetStatus ['date'] - member ['optimeDate']
KeyError: 'optimeDate'

Wrap long queries

Some queries are not displayed because they're too large and db.currentOp() doesn't return them. But all other queries are truncated by the right margin of the terminal. Any chance to wrap the query onto multiple lines? Bonus points for pretty-printing it.

ModuleNotFoundError: No module named 'motop'

Why ?

pip3 install motop

WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting motop
  Downloading https://files.pythonhosted.org/packages/8b/75/536088432630057a64870f9e158d029c52190e2ac6cbc0b8e47dfb941f9b/motop-4.2.tar.gz
Collecting pymongo (from motop)
  Downloading https://files.pythonhosted.org/packages/dd/39/7aadf43df2f18bb3d1b140914f0bc4eee7d4209fa6e459f3fa2cdd42127b/pymongo-4.0.1-cp36-cp36m-manylinux1_x86_64.whl (452kB)
    100% |████████████████████████████████| 460kB 2.0MB/s 
Collecting argparse (from motop)
  Downloading https://files.pythonhosted.org/packages/f2/94/3af39d34be01a24a6e65433d19e107099374224905f1e0cc6bbe1fd22a2f/argparse-1.4.0-py2.py3-none-any.whl
Installing collected packages: pymongo, argparse, motop
  Running setup.py install for motop ... done
Successfully installed argparse-1.4.0 motop-4.2 pymongo-4.0.1
motop 
Traceback (most recent call last):
  File "/usr/local/bin/motop", line 3, in <module>
    from libmotop import motop
ModuleNotFoundError: No module named 'motop'
python3 -V
Python 3.6.8
pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

I also have the same problem with pip 21.3.1.

pip3 freeze
motop==4.2
pymongo==4.0.1
CentOS Linux 7 (Core)

motop 1.3 install via pypi failing

Install from egg via pypi. FAILS

dave@xxps:~$ mkvirtualenv motest -i motop
New python executable in motest/bin/python
Installing setuptools............done.
Installing pip...............done.
Downloading/unpacking motop
  Downloading motop-2.0.tar.gz
  Running setup.py egg_info for package motop
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/dave/.virtualenvs/motest/build/motop/setup.py", line 4, in <module>
        from src.Motop import Motop
    ImportError: No module named src.Motop
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/dave/.virtualenvs/motest/build/motop/setup.py", line 4, in <module>

    from src.Motop import Motop

ImportError: No module named src.Motop

Install from zip master via github. SUCCEEDS

dave@xxps:~$ mkvirtualenv motest -i https://github.com/tart/motop/archive/master.zip
New python executable in motest/bin/python
Installing setuptools............done.
Installing pip...............done.
Downloading/unpacking https://github.com/tart/motop/archive/master.zip
  Downloading master.zip
  Running setup.py egg_info for package from https://github.com/tart/motop/archive/master.zip

Downloading/unpacking pymongo (from motop==1.3)
  Downloading pymongo-2.5.tar.gz (294kB): 294kB downloaded
  Running setup.py egg_info for package pymongo

Installing collected packages: pymongo, motop
  Running setup.py install for pymongo
    building 'bson._cbson' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.7 -c bson/_cbsonmodule.c -o build/temp.linux-x86_64-2.7/bson/_cbsonmodule.o
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.7 -c bson/time64.c -o build/temp.linux-x86_64-2.7/bson/time64.o
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.7 -c bson/buffer.c -o build/temp.linux-x86_64-2.7/bson/buffer.o
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.7 -c bson/encoding_helpers.c -o build/temp.linux-x86_64-2.7/bson/encoding_helpers.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/bson/_cbsonmodule.o build/temp.linux-x86_64-2.7/bson/time64.o build/temp.linux-x86_64-2.7/bson/buffer.o build/temp.linux-x86_64-2.7/bson/encoding_helpers.o -o build/lib.linux-x86_64-2.7/bson/_cbson.so
    building 'pymongo._cmessage' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.7 -c pymongo/_cmessagemodule.c -o build/temp.linux-x86_64-2.7/pymongo/_cmessagemodule.o
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.7 -c bson/buffer.c -o build/temp.linux-x86_64-2.7/bson/buffer.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/pymongo/_cmessagemodule.o build/temp.linux-x86_64-2.7/bson/buffer.o -o build/lib.linux-x86_64-2.7/pymongo/_cmessage.so

  Running setup.py install for motop
    changing mode of build/scripts-2.7/motop.py from 664 to 775

    changing mode of /home/dave/.virtualenvs/motest/bin/motop.py to 775
Successfully installed pymongo motop

connecting user based mongodb instance

Traceback (most recent call last):
File "/bin/motop", line 4, in
motop.run()
File "/usr/lib/python2.7/site-packages/libmotop/motop.py", line 78, in run
servers = commonServers(config, arguments)
File "/usr/lib/python2.7/site-packages/libmotop/motop.py", line 67, in commonServers
return [Server(section, **dict(config.items(section))) for section in config.sections()]
File "/usr/lib/python2.7/site-packages/libmotop/server.py", line 30, in init
self.tryToConnect()
File "/usr/lib/python2.7/site-packages/libmotop/server.py", line 43, in tryToConnect
self.__connection.admin.authenticate(self.__username, self.__password)
File "/usr/lib64/python2.7/site-packages/pymongo/database.py", line 1048, in authenticate
connect=True)
File "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 505, in _cache_credentials
sock_info.authenticate(credentials)
File "/usr/lib64/python2.7/site-packages/pymongo/pool.py", line 523, in authenticate
auth.authenticate(credentials, self)
File "/usr/lib64/python2.7/site-packages/pymongo/auth.py", line 470, in authenticate
auth_func(credentials, sock_info)
File "/usr/lib64/python2.7/site-packages/pymongo/auth.py", line 450, in _authenticate_default
return _authenticate_scram_sha1(credentials, sock_info)
File "/usr/lib64/python2.7/site-packages/pymongo/auth.py", line 201, in _authenticate_scram_sha1
res = sock_info.command(source, cmd)
File "/usr/lib64/python2.7/site-packages/pymongo/pool.py", line 419, in command
collation=collation)
File "/usr/lib64/python2.7/site-packages/pymongo/network.py", line 116, in command
parse_write_concern_error=parse_write_concern_error)
File "/usr/lib64/python2.7/site-packages/pymongo/helpers.py", line 210, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: Authentication failed.

"invalid end of string" crash

Unfortunately I don't have more information about this than the output:

Server           Opid   Client           Type     Sec   Locks                          Namespace                                         Query
localhost:27017  92510  127.0.0.1:35554  query    0     r                              stockbase-prod.companies                          query not recording (too large)

Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in <module>
    pkg_resources.run_script('motop==4.1', 'motop')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/EGG-INFO/scripts/motop", line 4, in <module>
    motop.run()
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/motop.py", line 95, in run
    queryScreen.action()
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/queryscreen.py", line 309, in action
    block.reset()
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/queryscreen.py", line 221, in reset
    for op in server.currentOperations(hideReplicationOperations):
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/server.py", line 109, in currentOperations
    operations = self.__execute(self.__connection.admin.current_op)
  File "/usr/local/lib/python2.7/dist-packages/motop-4.1-py2.7.egg/libmotop/server.py", line 64, in __execute
    return procedure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/database.py", line 550, in current_op
    return self['$cmd.sys.inprog'].find_one()
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/collection.py", line 721, in find_one
    for result in cursor.limit(-1):
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 1038, in next
    if len(self.__data) or self._refresh():
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 982, in _refresh
    self.__uuid_subtype))
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/cursor.py", line 925, in __send_message
    self.__compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/pymongo/helpers.py", line 117, in _unpack_response
    compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 533, in decode_all
    tz_aware, uuid_subtype, compile_re))
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 170, in _get_array
    as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 159, in _get_object
    encoded, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 159, in _get_object
    encoded, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 331, in _elements_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 320, in _element_to_dict
    data, position, as_class, tz_aware, uuid_subtype, compile_re)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.7.1-py2.7-linux-x86_64.egg/bson/__init__.py", line 149, in _get_string
    raise InvalidBSON("invalid end of string")
bson.errors.InvalidBSON: invalid end of string

Support sharded enviroments

It would be super cool if motop could be configured to connect to a mongos instance. This way it would be super easy to monitor queries accross a cluster.

Right now it crashes with the following message:

Traceback (most recent call last):
  File "/usr/local/bin/motop", line 5, in <module>
    pkg_resources.run_script('motop==3.1', 'motop')
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.40-py2.7.egg/pkg_resources.py", line 505, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/distribute-0.6.40-py2.7.egg/pkg_resources.py", line 1245, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/site-packages/motop-3.1-py2.7.egg/EGG-INFO/scripts/motop", line 4, in <module>
    motop.run()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/motop-3.1-py2.7.egg/libmotop/motop.py", line 98, in run
    queryScreen.action()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/motop-3.1-py2.7.egg/libmotop/queryscreen.py", line 296, in action
    block.reset()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/motop-3.1-py2.7.egg/libmotop/queryscreen.py", line 42, in reset
    status = server.status()
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/motop-3.1-py2.7.egg/libmotop/server.py", line 108, in status
    values['activeClients'] = Value(status['globalLock']['activeClients']['total'])
KeyError: 'globalLock'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.