当前位置:网站首页>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效果图,如下所示:
边栏推荐
- ftp登录时,报错“530 Login incorrect.Login failed”
- Web security summary
- 2022年中南大学夏令营面试经验
- CSRF
- Intel 13th generation core flagship exposure, single core 5.5ghz
- Excel表格转到Word中,表格不超边缘纸张范围
- Some common terms
- How to get started embedded future development direction of embedded
- How to clean up v$rman_ backup_ job_ Details view reports error ora-02030
- 【学习笔记】dp 状态与转移
猜你喜欢
Kibana~Kibana的安装和配置
Mmc5603nj geomagnetic sensor (Compass example)
Understand go language context in one article
Abandon the Internet after 00: don't want to enter a big factory after graduation, but go to the most fashionable Web3
STL教程10-容器共性和使用场景
The tutor put forward 20 pieces of advice to help graduate students successfully complete their studies: first, don't plan to take a vacation
2022 northeast four provinces match VP record / supplementary questions
ASP. Net hotel management system
Gut | Yu Jun group of the Chinese University of Hong Kong revealed that smoking changes intestinal flora and promotes colorectal cancer (do not smoke)
MATLAB extrait les données numériques d'un fichier txt irrégulier (simple et pratique)
随机推荐
How to become a senior digital IC Design Engineer (1-2) Verilog coding syntax: Verilog 1995, 2001, 2005 standards
Incremental database backup - DB incr DB full
Multi dimensional monitoring: the data base of intelligent monitoring
Phpcms prompt message page Jump to showmessage
Redis things
(2) Base
How to mix embedded MCU, arm and DSP?
PHP基础
PHP server interacts with redis with a large number of close_ Wait analysis
P3250 [HNOI2016] 网络 + [NECPC2022] F.Tree Path 树剖+线段树维护堆
ftp登录时,报错“530 Login incorrect.Login failed”
Abandon the Internet after 00: don't want to enter a big factory after graduation, but go to the most fashionable Web3
Excel表格转到Word中,表格不超边缘纸张范围
Arctangent entropy: the latest SCI paper in July 2022
R语言使用原生包(基础导入包、graphics)中的hist函数可视化直方图(histogram plot)
uniapp实现点击加载更多
动态规划(区间dp)
[vtk] interpretation of source code comments of vtkwindowedsincpolydatafilter
Technical experts from large factories: how can engineers improve their communication skills?
Programmers' entrepreneurial trap: taking private jobs