96.6. Template

本文涉及的产品
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 Tair(兼容Redis),内存型 2GB
简介:

模板的导入步骤是首先点击"Choose File"按钮选择文件

然后点击Import按钮

确认导入事项,最后点击Import按钮。

完成倒入后,配置数据采集脚本,请继续阅读下面章节。

96.6.1. Nginx

wget http://forums.cacti.net/download/file.php?id=12676			
			

http://forums.cacti.net/about26458.html

nginx 配置

    location /nginx_status {
        stub_status on;
        access_log  off;
        allow 22.82.21.12;
        deny all;
    }
			

96.6.2. php-fpm

yum -y install perl-FCGI perl-FCGI-Client perl-LWP-Protocol-http10

git clone https://github.com/oscm/Cacti.git
cd Cacti
cp Templates/php-fpm/get_php_fpm_status.pl /usr/share/cacti/scripts/
chmod +x /usr/share/cacti/scripts/get_php_fpm_status.pl
			

配置连接协议

# vim +/mode /usr/share/cacti/scripts/get_php_fpm_status.pl

#my $mode = MODE_FCGI; 注释此行
my $mode = MODE_HTTP; 添加此行
			

配置 php-fpm.conf 文件

; Default Value: not set
pm.status_path = /status			
			

配置nginx

    location ~ ^/(status|ping)$ {
        access_log off;
        allow 22.82.21.12;
        deny all;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
        include fastcgi_params;
    }		
			

96.6.3. MySQL

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

$ cd /usr/local/src/
$ wget http://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.8.tar.gz
$ tar zxvf better-cacti-templates-1.1.8.tar.gz
$ cd better-cacti-templates-1.1.8/
$ cp scripts/ss_get_mysql_stats.php /usr/share/cacti/scripts/
			

default password

			
vim /usr/share/cacti/site/scripts/ss_get_mysql_stats.php.cnf
<?php
$mysql_user = "root";
$mysql_pass = "s3cret";
?>		
			
			

Import Templates

倒入下面模板 templates/cacti_host_template_x_mysql_server_ht_0.8.6i-sver1.1.8.xml

			
"Import/Export" -> "Import Templates" -> "Import Template from Local File" -> Import
			
			

设置模版

			
Templates -> 

X MyISAM Indexes DT
X MyISAM Key Cache DT
X MySQL Binary/Relay Logs DT
X MySQL Command Counters DT
X MySQL Connections DT
X MySQL Files and Tables DT
X MySQL Handlers DT
X MySQL Network Traffic DT
X MySQL Processlist DT
X MySQL Query Cache DT
X MySQL Query Cache Memory DT
X MySQL Replication DT
X MySQL Select Types DT
X MySQL Sorts DT
X MySQL Table Locks DT
X MySQL Temporary Objects DT
X MySQL Threads DT
X MySQL Transaction Handler DT

->

Custom Data
Hostname
Username	#单击复选框,并输入默认用户名
Password	#单击复选框,并输入默认密码
Port

-> Save
			
			

96.6.4. Redis

easy_install redis
			

https://github.com/oscm/Cacti.git

cp redis-stats.py /usr/share/cacti/scripts/			
			

测试采集脚本

# python redis-stats.py 172.18.52.163
total_connections_received:578761 connected_clients:14 used_memory:870032 expires:47 keys:47 total_commands_processed:1814080			
			

96.6.5. Percona JMX Monitoring Template for Cacti

http://www.percona.com/doc/percona-monitoring-plugins/1.0/cacti/jmx-templates.html




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore &nbsp; &nbsp; ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库&nbsp;ECS 实例和一台目标数据库&nbsp;RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&amp;RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
5月前
|
JavaScript 前端开发 编译器
模板编译template的背后,究竟发生了什么事?带你了解template的纸短情长
该文章深入探讨了Vue.js中从模板(template)到渲染(render)过程中的编译机制,解释了模板是如何被转化为可执行的渲染函数,并最终呈现为用户界面的全过程。
|
6月前
|
XML 安全 JavaScript
goctl 技术系列 - text/template 深入讲解
goctl 技术系列 - text/template 深入讲解
|
9月前
<template> 上的 v-for​
<template> 上的 v-for​
|
9月前
|
编译器 测试技术 调度
C++ 中 template<class T>和template<typename T>的区别
C++ 中 template<class T>和template<typename T>的区别
396 0
|
JavaScript 前端开发
成功解决Component template should contain exactly one root element
成功解决Component template should contain exactly one root element
|
程序员 编译器 C++
2023-2-19-What is ‘ template<typename E, E V> ‘?
2023-2-19-What is ‘ template<typename E, E V> ‘?
62 0
|
存储 编译器 C++
【C++模板】——template
【C++模板】——template
|
C++ 程序员 编译器
理解模板类型推断(template type deduction)
理解模板类型推断(template type deduction) 我们往往不能理解一个复杂的系统是如何运作的,但是却知道这个系统能够做什么。C++的模板类型推断便是如此,把参数传递到模板函数往往能让程序员得到满意的结果,但是却不能够比较清晰的描述其中的推断过程。
1433 0
|
C++ 程序员 编译器
现代C++之理解模板类型推断(template type deduction)
现代C++之理解模板类型推断(template type deduction)目录 ParamType是指针或者引用类型ParamType是一个Universal ReferenceParamType既不是指针也不是引用数组参数函数参数要点总结 正文 理解模板类型推断(template type deduction)我们往往不能理解一个复杂的系统是如何运作的,但是却知道这个系统能够做什么。
1605 0