Cacti Monitors multiple ports of MySQLServer

Source: Internet
Author: User
To monitor the performance of mysqlserver, it is estimated that many people use the mysql-cacti-templates template in cacti, but its default configuration only supports monitoring of the standard mysql3306 port. In fact, its script supports multiple ports, but the configuration in the template is not supported by default. The script parameters are as follows: Usage: phpss_get_mysql_stats

To monitor the performance of mysql server, it is estimated that many people use the mysql-cacti-templates template in cacti. However, its default configuration only supports monitoring of standard mysql port 3306.

In fact, its script supports multiple ports, but the configuration in the template is not supported by default. The script parameters are as follows:

Usage:PhpSs_get_mysql _StatS. php -- host -- Items [OPTION]

-- Host Hostname to connect to; use host: port syntax to specify a port
Use:/path/to/socket if you want to connect via a UNIX socket
-- Items Comma-separat EdList of the items WhoSe data you want
-- User MySQL username; defaults to root if not given
-- Pass MySQL password; defaults to 5MebCCNrzdPYpx3L if not given
-- Heartbeat MySQL heartbeat table; defaults to ''(see mk-heartbeat)
-- Nocache Do not cache re SuLts in File
-- Port MySQL port; defaults to 3306 if not given
-- Mysql_ssl DdThe MYSQL_CLIENT_SSL flag to mysql_connect () call

Today, it took several hours to change it to support multiple ports.

It is also easy to change. Each Data Input needs to be changed to two places, but the number is large and the eyes are exhausted:

1. on the Console-> Data Templates, find the mysql template of mysql-cacti-templates, and edit:


Select the Use Per-Data Source Value (Ignore this Value) of the Port, which means that the user enters the Value of this parameter and then saves it.

Modify all the mysql templates as described above.

 

2. In Console-> Data Input Methods, change the Port number of all mysql Data items to "not allowed to be blank.


Deselect Allow Empty Input and save.

 

3. After all the preceding changes are completed, the system will prompt you to enter the port when creating the graph:

Enter your own mysql server port. Click create.

I have exported the modified template today, which is available below for users who need it.

Multi-port mysql template usage:

1. Import the template xml file to cacti

2. Put the ss_get_mysql_stats.php file in mysql-cacti-templates to the cacti/scripts directory.

The multi-port mysql template is modified based on better-cacti-templates-1.1.8.

Multi-port mysql template: http: // faRmErluo.googlecode.com/files/cacti_host_template_x_mysql_server_ht.xml

Mysql-cacti-templates: http://code.google.com/p/mysql-cacti-templates/

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.