轻便式Redis 化监Monitor是面向研发人员的图形可视化监控工具,借鉴了LEPUS(天兔)监控平台以及redis-cli info命令输出的开可视控工监控指标项,去掉了一些不必要、源工看不懂的具面具监控项,目前采集了数据库连接数、向开QPS、便式内存使用率统计和同步复制延迟时长。图形
Redis 化监Monitor可以监控单机模式、哨兵模式、开可视控工集群模式,并且录入一个主库或者从库IP,自动发现主库或者从库IP信息,无需人工再次录入。
采用远程连接方式获取数据,所以无需在Redis服务器端部署相关agent或计划任务,可实现微信和邮件报警。
注:监控环境为Redis 6.2以上版本。
连接数
shell> yum install -y php-pear php-devel php httpd mysql php-mysqlnd php-redis
shell> systemctl restart httpd.service
> config set requirepass yourPassword
把https://github.com/hcymysql/redis_monitor/archive/master.zip
安装包解压缩到 /var/www/html/目录下
cd /var/www/html/redis_monitor/
chmod 755 ./mail/sendEmail
chmod 755 ./weixin/wechat.py
(注:邮件和微信报警调用的第三方工具,所以这里要赋予可执行权限755)
cd /var/www/html/mongo_monitor/
mysql -uroot -p123456 < redis_monitor_schema.sql
(注:mysql_status_history表引擎可以更改为RocksDB引擎,支持数据压缩,这对于减小存储空间以及增快IO效率都有直接的帮助)
https://www.percona.com/blog/2018/04/30/a-look-at-myrocks-performance/
mysql> INSERT INTO `redis_status_info`(`id`,`host`,`tag`,`pwd`,`port`,`monitor`,`send_mail`,`send_mail_to_list`,`send_weixin`,`send_weixin_to_list`,`alarm_threads_running`,`threshold_alarm_threads_running`,`alarm_used_memory_status`,`threshold_warning_used_memory`) VALUES (1,'192.168.176.27','Redis测试','hechunyang123456',6379,1,1,'hechunyang@126.com',1,'hechunyang',NULL,150,NULL,'200M');
注,以下字段可以按照需求变更:
vim /var/www/html/redis_monitor/conn.php
$con = mysqli_connect("127.0.0.1","admin","hechunyang","redis_monitor","3306") or die("数据库链接错误".mysql_error());
改成你的Redis Monitor监控工具表结构(redis_monitor库)连接信息。
cd /var/www/html/redis_monitor/mail/
vim mail.php
system("./mail/sendEmail -f chunyang_he@139.com -t '{ $this->send_mail_to_list}' -s smtp.139.com:25 -u '{ $this->alarm_subject}' -o message-charset=utf8 -o message-content-type=html -m '报警信息:<br><fontcolor='#FF0000'>{ $this->alarm_info}</font>' -xu chunyang_he@139.com -xp '123456' -o tls=no");
改成你的发件人地址,账号密码,里面的变量不用修改。
cd /var/www/html/redis_monitor/weixin/
vim wechat.py
微信企业号设置移步
https://github.com/X-Mars/Zabbix-Alert-WeChat/blob/master/README.md
看此教程配置。
crontab -l
*/1 * * * * /usr/bin/php /var/www/html/redis_monitor/check_redis_status.php > /dev/null 2 >&1
check_redis_status.php(用来采集被监控端Redis状态信息和触发报警)
vim redis_status_monitor.php
http-equiv="refresh" cnotallow="600"
默认页面每600秒自动刷新一次。
http://yourIP/redis_monitor/redis_status_monitor.php
加一个超链接,可方便地接入你们的自动化运维平台里。
贺春旸,凡普金科和爱钱进DBA团队负责人,《MySQL管理之道:性能调优、高可用与监控》第一&二版、《MySQL运维进阶指南》作者,曾任职于中国移动飞信、安卓机锋网。五次荣获dbaplus年度MVP,致力于MariaDB、MongoDB等开源技术的研究,主要负责数据库性能调优、监控和架构设计。
工具下载:https://github.com/hcymysql/redis_monitor
责任编辑:武晓燕 来源: dbaplus社群 Redis轻便式图形(责任编辑:娱乐)
分期乐提前还款利息的计算方式是怎样的 分期乐分36期可以提前还款吗?
Prompt都不需要了,动动手就能玩多模态对话系统,iChat来啦!