The--mongostat tool is a self-mongdb monitoring tool that can be used to monitor the operation of MongoDB in its current state:
[Email protected] ~]#/usr/local/mongodb341/bin/mongostat 2
Insert Query Update delete getmore command dirty used flushes vsize res qrw ARW net_in net_out conn Time
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 79b 22.5k 2 Dec 29 13:22:35.349
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 79b 22.5k 2 Dec 29 13:22:37.349
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 78b 22.5k 2 Dec 29 13:22:39.350
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 79b 22.5k 2 Dec 29 13:22:41.349
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 79b 22.5k 2 Dec 29 13:22:43.348
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 78b 22.5k 2 Dec 29 13:22:45.349
*0 *0 *0 *0 0 0|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 78b 22.5k 2 Dec 29 13:22:47.350
*0 *0 *0 *0 0 1|0 0.0% 0.0% 0 439M 56.0M 0|0 0|0 105b 22.5k 2 Dec 29 13:22:49.352
The--mongotop tool is a top monitoring tool from MongoDB that can be used to monitor the current MongoDB database for resources that are resource intensive and have a reference role for optimization:
[Email protected] ~]#/usr/local/mongodb341/bin/mongotop 2
2016-12-29t13:24:35.530+0800 Connected to:127.0.0.1
NS Total Read Write 2016-12-29t13:24:37+08:00
Admin.system.roles 0ms 0ms 0ms
Admin.system.users 0ms 0ms 0ms
Admin.system.version 0ms 0ms 0ms
Dbk.col 0ms 0ms 0ms
Dbk.test 0ms 0ms 0ms
Dbking.col 0ms 0ms 0ms
Dbking.test 0ms 0ms 0ms
Local.col 0ms 0ms 0ms
Local.startup_log 0ms 0ms 0ms
Local.system.replset 0ms 0ms 0ms
NS Total Read Write 2016-12-29t13:24:39+08:00
Admin.system.roles 0ms 0ms 0ms
Admin.system.users 0ms 0ms 0ms
Admin.system.version 0ms 0ms 0ms
Dbk.col 0ms 0ms 0ms
Dbk.test 0ms 0ms 0ms
Dbking.col 0ms 0ms 0ms
Dbking.test 0ms 0ms 0ms
Local.col 0ms 0ms 0ms
Local.startup_log 0ms 0ms 0ms
Local.system.replset 0ms 0ms 0ms
Mongostat and Mongotop monitoring of the MongoDB database running state