Install Mtools in Ubuntu for MongoDB log analysis

According to mtools official github repo, its says that “mtools is a collection of helper scripts to parse, filter, and visualize MongoDB log files (mongod, mongos). mtools also includes mlaunch, a utility to quickly set up complex MongoDB test environments on a local machine, and mtransfer, a tool for transferring databases between MongoDB instances.”

github repo ->

Tutorials ->

Now I am giving you the steps, by which you can easily install Mtools in Ubuntu

Check Python version

Mtools does wok in python 3.6 and above.

python - version

Then upgrade python

In terminal first run this command

sudo update-alternatives --config python

If you find following error

update-alternatives: error: no alternatives for python3

Update Alternative, at the last of this command I placed 1 this is called priority.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1

sudo update-alternatives --set python /usr/bin/python3.6

If any error you can see regarding setuptools then run

sudo apt-get install python3-setuptools

Now check the version

python - version

Now system is ready for installation of Mtools

sudo mkdir -p mtools_setup  //making a directory
sudo chmod -R 744 mtools_setup   //give permission
cd mtools_setup

Download mtools latest setup from python repo →


tar xzvf mtools-1.6.4.tar.gz //unziooing
cd mtools-1.6.4/ 
sudo python install

Now check the tutorial fromhere