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 -> https://github.com/rueckstiess/mtools

Tutorials -> http://blog.rueckstiess.com/mtools/install.html

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
>2.7

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

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

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

Now check the version

python - version
>3.6.9

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 →https://pypi.org/project/mtools/

wget https://files.pythonhosted.org/packages/fc/8e/a3dda6a87a0566fea0997d74f9ef41a79d00ae72010c0bb2ad2c1fd3e430/mtools-1.6.4.tar.gz

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

Now check the tutorial fromhere 
http://blog.rueckstiess.com/mtools/index.html