Using SSIS to build MySQL monitoring tool _ MySQL

Source: Internet
Author: User
Tags ssis
Tools for batch monitoring of the MySQLdb layer in Linux are relatively scarce, and SSISDIY is used. use the SSIS package to read the configuration table information to monitor MySQL. Then, send an email to DBA1 to sort out a global information table, including ip addresses and monitoring dimensions. the table creation statement is as follows: CREAT monitoring tool mysql management tool

Tools for batch monitoring MySQL db layers in Linux are relatively scarce, and SSIS is used for DIY.

Use the SSIS package to read the configuration table information to monitor MySQL and send feedback to DBA By email according to the actual situation.

1. sort out a global information table, including ip addresses and monitoring dimensions.

498) this. width = 498; "/>

The table creation statement is as follows:

 
 
  1. CREATE TABLE [dbo].[all_host_info](
  2. [ip] [varchar](20) NULL,
  3. [isactive] [tinyint] NULL,
  4. [ishost] [tinyint] NULL,
  5. [isslave] [tinyint] NULL,
  6. [isjob] [tinyint] NULL,
  7. [isobject] [tinyint] NULL,
  8. [isprivileges] [tinyint] NULL
  9. ) ON [PRIMARY]

2. create an ssis package named mysqlmonitor and create the following variables.

498) this. width = 498; "/>

3. create the TSQL_SLAVE SQL task component in the control flow

Link oledb to the SQL Server where all_host_info is located. enter the following code in sqlsourcetype:

 
 
  1. select count(1) as j from all_host_info where isslave=1;

Select a single row in result set.

498) this. width = 498; "/>

Enter the following result name in the result set and specify the variable j.

498) this. width = 498; "/>

4. create a TSQL_SLAVE_ID tsql task component.

Link to the ole link used by the TSQL_SLAVE component

498) this. width = 498; "/>

5. the content of the new SCRIPT component is as follows:

498) this. width = 498; "/>

498) this. width = 498; "/>

6. create a FOR loop as follows:

498) this. width = 498; "/>

7. drag a data stream in the FOR loop to write the read ip information to the object variable as follows.

498) this. width = 498; "/>

8. drag a FOReach_VAR foreach component into the for component. the content of the component is as follows:

498) this. width = 498; "/>

9 drag data flow components

498) this. width = 498; "/>

10 Mail

498) this. width = 498; "/>

The final components of package 11 are as follows:

498) this. width = 498; "/>

12. load the package into the job and send emails one hour. the monitoring principles of other dimensions are the same.

498) this. width = 498; "/>

Practice one skill and practice a hundred arts, and become a natural.

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.