using PowerShell Call Mtools Analyze MongoDB performance and send mail
Problem Description:
In MongoDB daily operations, it is often necessary to view the trend graph, slow query, overflow statement, and connection source of the number of connections.
Solution:
1. Mount the Windows Backup machine directory to the MongoDB local directory and copy the most recent log logrotate after switching to the backup directory.
Reference blog: "Mounting Windows system shared directory under Linux"
2. Install Mtools on the Windows Server.
Reference post: Install Mtools on 64-bit Windows Server R2
3. Write a PowerShell script, parse the log file through Mtools, and send the message.
GitHub Source Address: Https://github.com/UltraSQL/MongoDBDailyReport.git
How to use:
A) Place the DBA module in the appropriate MODULES\DBA directory.
b) Load the module in the configuration file: Import-module dba-force.
c) Create a task schedule and execute the MTOOLS.PS1 script at timed intervals.
650) this.width=650; "title=" clip_image002 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px, "alt=" clip_image002 "src=" Http://s3.51cto.com/wyfs02/M02/72/F7/wKioL1XxKcGQNDLtAACcTq4nMFM928.jpg "height=" 151 "border=" 0 "/>
This article is from the SQL Server deep dives blog, so be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1693437
Use PowerShell to invoke Mtools to analyze MongoDB performance and send mail