Percona_template_for_cacti added support for redis multi-instance monitoring Images

Source: Internet
Author: User

Percona_template_for_cacti added support for redis multi-instance monitoring Images

The cacti template of percona is still very handsome, but for multiple instances such as redis and memercache, only the default 6379 or one other port can be monitored (in short, all instances cannot be monitored ), this is a pity. To achieve monitoring of all objects that can be monitored, you must customize the template. After half a day of exploration, we finally achieved it. Let's take a look at the handsome one:

Steps:

1. Download The percona template and decompress it. Because the previous version was 1.0.1, it was modified based on the original version.

Wget http://www.percona.com/redir/downloads/percona-monitoring-plugins/1.0.1/percona-monitoring-plugins-1.0.1.tar.gz

2. Add the option port2 Based on the redis default template configuration file. When creating a redis monitoring image, you must enter the redis port number. If this parameter is left blank, the default port number is 6379, the ss_get_by_ssh.php script uses the port2 option to connect to the redis instance on the specified port:

Cd percona-monitoring-plugins-1.0.1/cacti/bin

? Bin./pmp-cacti-template \
> -- Script ../scripts/ss_get_by_ssh.php ../definitions/redis. def \
> -- Mpds port2> ../templates/cacti_host_template_percona_redis_server_ht_for_multi_instance.xml

Instructions for creating template scripts

? Bin./pmp-cacti-template -- help
Pmp-cacti-template generates a Cacti template from a definition file. For more
Details, please use the -- help option, or try 'perldoc pmp-cacti-template'
Complete documentation.

Usage: pmp-cacti-template <options> FILE

Options:
-- Cactiver Create templates for this Cacti version
-- Graph_height Height of generated graphs (default 120)
-- Graph_width Width of generated graphs (default 500)
-- Help Show this help message
-- Lint_check Complain about unused data found in the script
-- Mpds Comma-separated list of input method options to make
Per-data-source
-- Name_prefix Template name prefix (default Percona)
-- Poll_interval Polling interval (default 300)
-- Script Command-line script to use (required)
-- Smallint Create templates for 32-bit MySQL
-- Version Output version information and exit

Options and values after processing arguments:
-- Cactiver (No value)
-- Graph_height 120
-- Graph_width 500
-- Help TRUE
-- Lint_check FALSE
-- Mpds
-- Name_prefix Percona
-- Poll_interval 300
-- Script (No value)
-- Smallint FALSE
-- Version FALSE
? Bin

3. Import the newly created redis template cacti_host_template_percona_redis_server_ht_for_multi_instance.xml on the cacti web Management page.

Console-> Import/Export-> Import Templates-> choose file-> import

4. Modify the title of the image in the apsaradb for redis template to distinguish the image from the instance. This example uses the port number you entered when creating the image, and uses the variable in cacti | reference

Console-> Templates-> Graph Templates-> search 'redis 'and select a redis template-> in Graph Template title-> | host_description |-redis Commands-| input_port2 |-> save

5. Create a monitoring image for redis. Enter the port number.

6. If you have monitoring redis 6379 before importing a new template, the image display name is abnormal, for example, 192.168.0.19 _ Redis19-Redis Unsaved Changes-| input_port2 |, not 192.168.0.19 _ Redis19-Redis Unsaved Changes-6382

Datasource before modification

Console-> Create-> Data Sources-> search 'redis 'and select a data source-> in the Custom Data, let port2 = 6379-> save

7. The script refreshes the image display name.

Under the cacti server script directory:

[Root @ admin200 cli] # pwd
/Var/www/cacti/cli
[Root @ admin200 cli] # php-q poller_graphs_reapply_names.php-id = All-d-s = Redis
WARNING: Do not interrupt this script. Interrupting during rename can cause issues
DEBUG: There are '000000' Graphs to rename
DEBUG: Graph Name '2017. 168.0.19 _ Redis19-Redis Commands-192 'starting
DEBUG: Graph Rename Done for Graph '192. 168.0.19 _ Redis19-Redis Commands-100'
DEBUG: Graph Name '2017. 168.0.19 _ Redis19-Redis Connections-192 'starting
DEBUG: Graph Rename Done for Graph '192. 168.0.19 _ Redis19-Redis Connections-100'
DEBUG: Graph Name '1970. 168.0.19 _ Redis19-Redis Memory-100' starting
DEBUG: Graph Rename Done for Graph '192. 168.0.19 _ Redis19-Redis Memory-100'

8. OK. Refresh the web image and it will display normally. See the beginning of this article.

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.