Mssql/wmi/powershell (a) Introduction

Source: Internet
Author: User

This article mainly introduces Windows WMI and PowerShell to implement real-time alarm, if you feel trouble, the use of MSSQL WMI alerts, relatively simpler.


Why consider MSSQL combined with WMI and PowerShell? What can they do?

Wmi/powershell are all Windows plug-ins and functions, using them to achieve MSSQL monitoring, automation operations, and so on, is undoubtedly the simplest and most convenient.


Why not consider using a monitoring tool?

Free tools do not meet demand, powerful tools (SCOM) are too expensive, and small companies rarely consider buying.


First, the police type of real-time reporting

What is a real-time alarm? That is, once the alarm information is found, the corresponding personnel can be immediately notified. In order to receive the real-time alarm information, it is the most convenient and real-time in PowerShell by comparing the SMS/Mail/qq/.


Ii. WMI Events

First, make sure that the WMI service is started (some functions like Zabbix agent, specifically for data acquisition)

1) EventFilter

Event filters, which are used primarily to filter the WMI event information

2) Consumer

Event consumers, primarily for triggering actions such as invoking scripts, logging, executing commands, etc.

3) Binding

Event binding, primarily used to bind eventfilter with consumer to enable real-time actions

For the combination of EventFilter, consumer and binding, and known as WMI Monitor,powershell as PS, it is convenient to refer to the following



Three, real-time alarm realization principle

The general principle is as follows:

WMI monitor-> Database Server (intranet)->powershell-> monitoring Server (internal and external network), send

Register WMI Monitor on the MSSQL server and remotely invoke the send script on the monitoring server via PowerShell. Both PowerShell and WMI can be accessed remotely, and the reason for using PowerShell is relatively simple and secure.


Iv. Types of monitoring

Mssql+wmi+ps

1) Database DDL operations

2) Changes in database mirroring status

3) Deadlock

4) Update/delete statement (data collected by SQL Server, WMI triggers real-time alarms)

.....


V. Automation type of work

Mssql+ps

1) Backup files are deleted periodically

2) Backup file Availability Verification

3) Backup file periodic restore check

.....


The following chapters will cover each function and category.

This article is from the "Aimax" blog, make sure to keep this source http://aimax.blog.51cto.com/11610508/1965662

Mssql/wmi/powershell (a) Introduction

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.