Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method for acquiring Mysql database monitoring data by using Python language

A technology of monitoring data and language collection, which is applied in hardware monitoring and other directions, and can solve problems such as data having no practical significance

Inactive Publication Date: 2019-05-03
CHINA CHANGFENG SCI TECH IND GROUPCORP
View PDF0 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] At present, there are many ways to realize the monitoring data collection of Mysql database. Python is a more convenient way. Mysql has many indicators to choose from. Generally, it is basically collected according to the order, which will cause a lot of collected data to be meaningless.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method for acquiring Mysql database monitoring data by using Python language
  • A method for acquiring Mysql database monitoring data by using Python language

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0014] Such as figure 1 As shown, the Mysql monitoring data collection process of the present invention is as follows:

[0015] (1) Obtain the machine name of the host through Python's socket.gethostname() method;

[0016] (2) Put the connection information of multiple Mysql databases into a string array;

[0017] (3) Use the loop function, call the MySQLdb module of Python to connect to each Mysql database, and call the sql statement: SHOW GLOBAL STATUS query the various indicators of the database, and put it into a Python dictionary;

[0018] (4) Obtain the monitoring indicators of Mysql, and extract the values ​​of several important monitoring data that need to be collected, including the following indicators:

[0019] MySQL_QPS (query rate per second);

[0020] MySQL_TPS (system throughput);

[0021] Slow_queries (slow queries / sec);

[0022] Threads_created (the total number of connections created);

[0023] Threads_running (the number of running connections);

[0024] Aborted_connects ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method for acquiring Mysql database monitoring data by using Python language. The method comprises the following steps: acquiring a machine name of a host through Python; putting the connection information of a plurality of Mysql databases into a character string array; connecting each Mysql database, inquiring each index of the database, and putting into a Python dictionary; obtaining Mysql monitoring indexes, and extracting values of a plurality of important monitoring indexes needing to be collected from the Mysql monitoring index, mainly comprising the query rate per second, the system throughput, the slow query number per second, the total number of established connections, the number of connections in operation, the number of rejected connections and the buffer pool index; calculating required monitoring index values; and arranging the calculated values of the monitoring items into a storage format of a time sequence database, and forwarding the values toa monitoring system.

Description

Technical field [0001] The invention relates to the field of system operation and maintenance monitoring, and in particular to a method for collecting Mysql database monitoring data using Python language. Background technique [0002] At present, there are many ways to realize the monitoring data collection of Mysql database. Python is a more convenient way. Mysql has many indicators to choose from. Generally, it is basically to collect all the data, which will cause a lot of collected data to be of no practical significance. Summary of the invention [0003] The purpose of the present invention is to provide a method for collecting Mysql database monitoring data in Python language, which is concise and efficient. [0004] The technical scheme of the present invention is as follows: [0005] A method for collecting Mysql database monitoring data using Python language is characterized by: [0006] (1) Obtain the machine name of the host through Python; [0007] (2) Put the connection in...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/30
Inventor 李浩王高磊
Owner CHINA CHANGFENG SCI TECH IND GROUPCORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products