当前位置:网站首页>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效果图,如下所示:
边栏推荐
- Google Earth engine (GEE) - ghsl global population grid dataset 250 meter resolution
- Web安全总结
- 836. 合并集合(DAY 63)并查集
- 如何将数字字符串转换为整数
- DS90UB949
- The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities
- How to become a senior digital IC Design Engineer (1-4) Verilog coding syntax: expression
- . \vmware-vdiskmanager. exe -k “c:\\xxxxx.vmdk”
- Internet socket (non) blocking write/read n bytes
- After a month, I finally got Kingdee offer! Share tetrahedral Sutra + review materials
猜你喜欢

鸿蒙第四次培训

Kubernetes 三打探针及探针方式

Arctangent entropy: the latest SCI paper in July 2022

The world's most popular font editor FontCreator tool

ftp登录时,报错“530 Login incorrect.Login failed”

Matlab extracts numerical data from irregular txt files (simple and practical)

Gut | Yu Jun group of the Chinese University of Hong Kong revealed that smoking changes intestinal flora and promotes colorectal cancer (do not smoke)

Spl06-007 air pressure sensor (example of barometer)

Encapsulate a koa distributed locking middleware to solve the problem of idempotent or repeated requests

Based on MCU, how to realize OTA differential upgrade with zero code and no development?
随机推荐
R语言使用gridExtra包的grid.arrange函数将ggplot2包的多个可视化图像横向组合起来,ncol参数自定义组合图列数、nrow参数自定义组合图行数
Excel快速跨表复制粘贴
Matlab extracts numerical data from irregular txt files (simple and practical)
Machine learning 3.2 decision tree model learning notes (to be supplemented)
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
VPP three-layer network interconnection configuration
Xml的(DTD,xml解析,xml建模)
程序员的创业陷阱:接私活
量化计算调研
2022 东北四省赛 VP记录/补题
ASP.NET-酒店管理系統
Google Earth engine (GEE) - ghsl global population grid dataset 250 meter resolution
Web安全总结
Cuiyusong, CTO of youzan: the core goal of Jarvis is to make products smarter and more reliable
软考中级软件设计师该怎么备考
How to become a senior digital IC Design Engineer (1-2) Verilog coding syntax: Verilog 1995, 2001, 2005 standards
Repo ~ common commands
JGG专刊征稿:时空组学
phpcms 提示信息页面跳转showmessage
解决msvcp120d.dll和msvcr120d.dll缺失