Use PowerShell to invoke Mtools to analyze MongoDB performance and send mail

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.