{"id":64135,"date":"2024-08-23T12:06:57","date_gmt":"2024-08-23T06:36:57","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=64135"},"modified":"2024-08-26T11:39:45","modified_gmt":"2024-08-26T06:09:45","slug":"mongo-monitor-mongo-current-operations-monitoring-by-lite-application","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/mongo-monitor-mongo-current-operations-monitoring-by-lite-application\/","title":{"rendered":"Mongo Monitor :  Mongo Current Operations monitoring by lite application"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>In this blog, we have mentioned how we can monitor the current operations of MongoDB instances with a small application developed by us. Its light weight application was developed using Nodejs, HTML, and javascript. It&#8217;s a very helpful application to monitor running queries on MongoDB and do the analysis on it:<\/p>\n<h2>Pre-requisite :<\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Nodejs and npm.<\/li>\n<li>Network connectivity between MongoDB and the application<\/li>\n<li>MongoDB Database user to authenticate the application with the database.<\/li>\n<li>Browser : Chrome, Edge, Firefox<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Git Download Link :<\/h2>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/github.com\/AkshayPC2611\/mongo-monitoring.git\">Mongo Monitor (MM)<\/a><\/p>\n<h2>How to Install \/ Use :<\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Create a database user on the MongoDB database with limited privileges (clustermonitor)\u00a0 to fetch the current operation data.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><em>use admin; db.createUser({ user: \"mongomon\", pwd: \"yourStrongPassword\", roles: [ { role: \"clusterMonitor\", db: \"admin\" }, { role: \"read\", db: \"admin\" } ] })\u00a0<\/em><\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Download the git repo from the download link.<\/li>\n<li>Make a change in the config file with the <em>host<\/em> and <em>port<\/em> of your Mongo instance.<\/li>\n<li>Go to the path where the repo is downloaded and open a terminal.<\/li>\n<li>Run command :\u00a0\u00a0<em>node .\/app.js<\/em><\/li>\n<li>Now open the link on browser:\u00a0 <em>http:\/\/localost:3000<\/em><\/li>\n<li>Login to the application using the newly created database user.<\/li>\n<li>Click on the current ops button.<\/li>\n<li>You will see the current operations running on the database by the user. operation id, query, seconds running ( in millis ), app name ( if exists ), and index used by the query.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>Here we are monitoring our Mongo long running queries \/ current operations using our lite application. In this application you can efficiently monitor your Mongo queries with only analytical information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog, we have mentioned how we can monitor the current operations of MongoDB instances with a small application developed by us. Its light weight application was developed using Nodejs, HTML, and javascript. It&#8217;s a very helpful application to monitor running queries on MongoDB and do the analysis on it: Pre-requisite : Nodejs [&hellip;]<\/p>\n","protected":false},"author":1920,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3},"categories":[5872],"tags":[55,4846,1499,1177],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/64135"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1920"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=64135"}],"version-history":[{"count":7,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/64135\/revisions"}],"predecessor-version":[{"id":64572,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/64135\/revisions\/64572"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=64135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=64135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=64135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}