当前位置:网站首页>Cacti监控Redis实现过程
Cacti监控Redis实现过程
2022-07-03 11:01:00 【星哥玩云】
Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具。被广泛的用于对服务器的运维监控中,Cacti提供了一种插件式的管理,只要按要求写好特定的模板,那么你就可以对任何服务进行流量监控。本文就是要为大家介绍两个模板,分别是MongoDB和Redis的Cacti模板,使用它,你可以对你的MongoDB和Redis服务进行流量监控。
1,升级Python,此时如果是系统默认的python版本,会出现以下错误
python setup.py install
Traceback (most recent call last):
File "setup.py", line 3, in ?
from redis import __version__
File "/usr/local/src/redis-2.4.11/redis/__init__.py", line 1, in ?
from redis.client import Redis, StrictRedis
File "/usr/local/src/redis-2.4.11/redis/client.py", line 240
with self.pipeline(True, shard_hint) as pipe:
^
SyntaxError: invalid syntax
2,安装python,先配置python环境,下载python源代码
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2
$ tar –jxvf Python-2.5.2.tar.bz2
$ cd Python-2.5.2
$ ./configure
$ make
$ make install
[[email protected] Python-2.5.2]# python
Python 2.4.3 (#1, Jun 11 2009, 14:09:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Version还是2.4.3的,解决办法如下:
#cd /usr/bin
#ll |grep python //查看该目录下python
#rm -rf python
重新做个软连接就可以了
[[email protected] Python-2.5.2]# ln -s /usr/local/bin/python /usr/bin/python
[[email protected] Python-2.5.2]#
[[email protected] Python-2.5.2]# python
Python 2.5.2 (r252:60911, Aug 4 2014, 14:43:36)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
3,然后下载redis的模板
wget http://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.8.tar.gz
配置监控脚本
mongodb或redis的监控所需到的是你下载目录中的better-cacti-templates-1.1.8\scripts下的
ss_get_by_ssh.php 这个脚本 这个脚本需要放在cacti的服务端。
如果你cacti是装到/var/www/html/cacti/目录下。
把该文件放在其下面的scripts目录下。别忘了看下权限。要有执行权限。
然后修改该文件。主要修改一下选项,大概在40行。
# ============================================================================
$ssh_user = 'root'; # SSH username
$ssh_port = 22; # SSH port
$ssh_iden = '-i /root/.ssh/id_rsa'; # SSH identity
##修改根据你的配置,你的ssh连接用户,还有认证私钥的位置。
大该在50行,还可以修改其默认的去探测的端口(如果redis不是正常默认端口启动需要修改这些)。
$redis_port = 6379; # Which port redis listens on
4,导入模板,模板目录为better-cacti-templates-1.1.8\templates
在cacti界面导入界面,创建redis服务器的Graph,如下所示:
5,去查看Graph效果图,如下所示:
边栏推荐
- After a month, I finally got Kingdee offer! Share tetrahedral Sutra + review materials
- MATLAB extrait les données numériques d'un fichier txt irrégulier (simple et pratique)
- 外插散点数据
- R language uses data The table package performs data aggregation statistics, calculates window statistics, calculates the median of sliding groups, and merges the generated statistical data into the o
- PHP server interacts with redis with a large number of close_ Wait analysis
- Phpcms prompt message page Jump to showmessage
- The tutor put forward 20 pieces of advice to help graduate students successfully complete their studies: first, don't plan to take a vacation
- Key switch: press FN when pressing F1-F12
- [OBS] configFile in ini format of OBS
- How to become a senior digital IC Design Engineer (1-4) Verilog coding syntax: expression
猜你喜欢
Numpy np.max和np.maximum实现relu函数
Solve undefined reference to`__ aeabi_ Uidivmod 'and undefined reference to`__ aeabi_ Uidiv 'error
Kibana - installation and configuration of kibana
活动预告 | 直播行业“内卷”,以产品力拉动新的数据增长点
STL教程9-容器元素深拷贝和浅拷贝问题
MATLAB提取不規則txt文件中的數值數據(簡單且實用)
ASP. Net hotel management system
Hongmeng third training (project training)
How to get started embedded future development direction of embedded
【学习笔记】dp 状态与转移
随机推荐
Multi dimensional monitoring: the data base of intelligent monitoring
Redis things
Encapsulate a koa distributed locking middleware to solve the problem of idempotent or repeated requests
R语言使用gridExtra包的grid.arrange函数将ggplot2包的多个可视化图像横向组合起来,ncol参数自定义组合图列数、nrow参数自定义组合图行数
Arctangent entropy: the latest SCI paper in July 2022
R language uses grid of gridextra package The array function combines multiple visual images of the lattice package horizontally, and the ncol parameter defines the number of columns of the combined g
P3250 [HNOI2016] 网络 + [NECPC2022] F.Tree Path 树剖+线段树维护堆
How to clean up v$rman_ backup_ job_ Details view reports error ora-02030
Unity3D学习笔记5——创建子Mesh
Asyncio warning deprecationwarning: there is no current event loop
Visual Studio 2022下载及配置OpenCV4.5.5
repo ~ 常用命令
软考中级软件设计师该怎么备考
R语言使用原生包(基础导入包、graphics)中的hist函数可视化直方图(histogram plot)
VS2015的下载地址和安装教程
Driver development based on I2C protocol
R language uses data The table package performs data aggregation statistics, calculates window statistics, calculates the median of sliding groups, and merges the generated statistical data into the o
(2) Base
R语言使用gridExtra包的grid.arrange函数将lattice包的多个可视化图像横向组合起来,ncol参数自定义组合图列数、nrow参数自定义组合图行数
MCDF实验1