当前位置:网站首页>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效果图,如下所示:
边栏推荐
- Arctangent entropy: the latest SCI paper in July 2022
- Incremental database backup - DB incr DB full
- 一些常用术语
- Phpcms prompt message page Jump showmessage
- phpcms 提示信息页面跳转showmessage
- Uniapp implementation Click to load more
- Leetcode 46: full arrangement
- Driver development based on I2C protocol
- VS2015的下载地址和安装教程
- 聊聊Flink框架中的状态管理机制
猜你喜欢
随机推荐
解决msvcp120d.dll和msvcr120d.dll缺失
R语言使用aggregate函数计算dataframe数据分组聚合的均值(sum)、不设置na.rm计算的结果、如果分组中包含缺失值NA则计算结果也为NA
Modular programming of single chip microcomputer
Leetcode 46: full arrangement
Using onvif protocol to operate the device
. \vmware-vdiskmanager. exe -k “c:\\xxxxx.vmdk”
ftp登录时,报错“530 Login incorrect.Login failed”
Redis things
The R language uses the hist function in the native package (basic import package, graphics) to visualize the histogram plot
R language uses the aggregate function to calculate the mean value (sum) of dataframe data grouping aggregation without setting na The result of RM calculation. If the group contains the missing value
Excel表格转到Word中,表格不超边缘纸张范围
Cadence background color setting
GCC compilation process and dynamic link library and static link library
.\vmware-vdiskmanager.exe -k “c:\\xxxxx.vmdk”
uniapp实现点击加载更多
Web security summary
This article explains the complex relationship between MCU, arm, MCU, DSP, FPGA and embedded system
How to make others fear you
CSRF
Abandon the Internet after 00: don't want to enter a big factory after graduation, but go to the most fashionable Web3









