├── README.md
├── check_redis_status.php
├── conn.php
├── css
├── bootstrap.min.css
├── fontawesome-all.min.css
├── simple-line-icons.css
├── styles.css
└── styles.css_bak
├── db_connect_graph_getdata.php
├── db_memory_graph_getdata.php
├── db_qps_graph_getdata.php
├── image
├── chart.gif
├── redis_monitor.jpg
├── redis_monitor_history1.png
├── redis_monitor_history2.png
├── redis_monitor_history3.png
├── redis_slowlog.png
└── table_info.png
├── js
├── echarts.common.min.js
├── jquery-3.3.1.min.js
├── shine.js
├── show_connect.php
├── show_graph_index.php
├── show_graph_qps.php
└── show_used_memory.php
├── mail
├── mail.php
└── sendEmail
├── redis_status_monitor.php
├── schema
└── redis_monitor_schema.sql
├── show_graph.php
├── slowlog.php
├── weixin
├── wechat.py
└── weixin.php
└── xadmin
├── css
├── font.css
└── xadmin.css
├── fonts
├── iconfont.eot
├── iconfont.svg
├── iconfont.ttf
└── iconfont.woff
├── images
├── aiwrap.png
└── bg.png
├── js
├── cookie.js
├── jquery-3.3.1.min.js
├── xadmin.js
└── xcity.js
└── lib
├── layui
├── css
│ ├── layui.css
│ ├── layui.mobile.css
│ └── modules
│ │ ├── code.css
│ │ ├── laydate
│ │ └── default
│ │ │ └── laydate.css
│ │ └── layer
│ │ └── default
│ │ ├── icon-ext.png
│ │ ├── icon.png
│ │ ├── layer.css
│ │ ├── loading-0.gif
│ │ ├── loading-1.gif
│ │ └── loading-2.gif
├── font
│ ├── iconfont.eot
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
├── images
│ └── face
│ │ ├── 0.gif
│ │ ├── 1.gif
│ │ ├── 10.gif
│ │ ├── 11.gif
│ │ ├── 12.gif
│ │ ├── 13.gif
│ │ ├── 14.gif
│ │ ├── 15.gif
│ │ ├── 16.gif
│ │ ├── 17.gif
│ │ ├── 18.gif
│ │ ├── 19.gif
│ │ ├── 2.gif
│ │ ├── 20.gif
│ │ ├── 21.gif
│ │ ├── 22.gif
│ │ ├── 23.gif
│ │ ├── 24.gif
│ │ ├── 25.gif
│ │ ├── 26.gif
│ │ ├── 27.gif
│ │ ├── 28.gif
│ │ ├── 29.gif
│ │ ├── 3.gif
│ │ ├── 30.gif
│ │ ├── 31.gif
│ │ ├── 32.gif
│ │ ├── 33.gif
│ │ ├── 34.gif
│ │ ├── 35.gif
│ │ ├── 36.gif
│ │ ├── 37.gif
│ │ ├── 38.gif
│ │ ├── 39.gif
│ │ ├── 4.gif
│ │ ├── 40.gif
│ │ ├── 41.gif
│ │ ├── 42.gif
│ │ ├── 43.gif
│ │ ├── 44.gif
│ │ ├── 45.gif
│ │ ├── 46.gif
│ │ ├── 47.gif
│ │ ├── 48.gif
│ │ ├── 49.gif
│ │ ├── 5.gif
│ │ ├── 50.gif
│ │ ├── 51.gif
│ │ ├── 52.gif
│ │ ├── 53.gif
│ │ ├── 54.gif
│ │ ├── 55.gif
│ │ ├── 56.gif
│ │ ├── 57.gif
│ │ ├── 58.gif
│ │ ├── 59.gif
│ │ ├── 6.gif
│ │ ├── 60.gif
│ │ ├── 61.gif
│ │ ├── 62.gif
│ │ ├── 63.gif
│ │ ├── 64.gif
│ │ ├── 65.gif
│ │ ├── 66.gif
│ │ ├── 67.gif
│ │ ├── 68.gif
│ │ ├── 69.gif
│ │ ├── 7.gif
│ │ ├── 70.gif
│ │ ├── 71.gif
│ │ ├── 8.gif
│ │ └── 9.gif
├── lay
│ └── modules
│ │ ├── carousel.js
│ │ ├── code.js
│ │ ├── colorpicker.js
│ │ ├── element.js
│ │ ├── flow.js
│ │ ├── form.js
│ │ ├── jquery.js
│ │ ├── laydate.js
│ │ ├── layedit.js
│ │ ├── layer.js
│ │ ├── laypage.js
│ │ ├── laytpl.js
│ │ ├── mobile.js
│ │ ├── rate.js
│ │ ├── slider.js
│ │ ├── table.js
│ │ ├── tree.js
│ │ ├── upload.js
│ │ └── util.js
├── layui.all.js
└── layui.js
└── test
/README.md:
--------------------------------------------------------------------------------
1 | # redis_monitor
2 |
3 | 轻便式Redis Monitor面向研发人员图形可视化监控工具,借鉴了LEPUS(天兔)监控平台以及redis-cli info命令输出的监控指标项,去掉了一些不必要看不懂的监控项,目前采集了数据库连接数、QPS、内存使用率统计和同步复制延迟时长,以及列出当前所有慢查询命令。
4 |
5 | Redis Monitor可以监控单机模式,哨兵模式,集群模式,并且录入一个主库或者从库IP,自动发现主库或者从库IP信息,无需人工再次录入。
6 |
7 | 采用远程连接方式获取数据,所以无需要在Redis服务器端部署相关agent或计划任务,可实现微信和邮件报警。
8 |
9 | 注:监控环境为Redis 6.2以上版本。
10 |
11 | 1)Redis状态监控
12 | 
13 |
14 | 2)点击图表,可以查看历史曲线图
15 |
16 | 连接数
17 | 
18 |
19 | QPS每秒查询量
20 | 
21 |
22 | 内存使用率
23 | 
24 |
25 | 3)点击端口号,可以列出该实例下的所有慢日志命令
26 |
27 | 慢查询
28 | 
29 |
30 | # 一、环境搭建
31 |
32 | 1)php-redis驱动安装(Centos 7系统)
33 |
34 | shell> yum install -y php-pear php-devel php httpd mysql php-mysqlnd php-redis
35 |
36 | 2)重启httpd服务
37 |
38 | shell> systemctl restart httpd.service
39 |
40 | 3)redis需要授权连接密码
41 |
42 | > config set requirepass yourPassword
43 |
44 | # 二、Redis monitor部署
45 |
46 | 把https://github.com/hcymysql/redis_monitor/archive/refs/heads/main.zip 安装包解压缩到 /var/www/html/目录下
47 |
48 | cd /var/www/html/redis_monitor/
49 |
50 | chmod 755 ./mail/sendEmail
51 |
52 | chmod 755 ./weixin/wechat.py
53 |
54 | (注:邮件和微信报警调用的第三方工具,所以这里要赋予可执行权限755)
55 |
56 | ### 1、导入Redis Monitor监控工具表结构(redis_monitor库)
57 |
58 | cd /var/www/html/mongo_monitor/schema/
59 |
60 | mysql -uroot -p123456 < redis_monitor_schema.sql
61 | #### 注:redis_status_history表引擎可以更改为rocksdb引擎,支持数据压缩,这对于减小存储空间以及增快IO效率都有直接的帮助。
62 | https://www.percona.com/blog/2018/04/30/a-look-at-myrocks-performance/
63 |
64 | ### 2、录入被监控主机的信息
65 |
66 | mysql> INSERT INTO `redis_status_info`(`id`,`host`,`tag`,`pwd`,`port`,`monitor`,
67 | `send_mail`,`send_mail_to_list`,`send_weixin`,`send_weixin_to_list`,`alarm_threads_running`,
68 | `threshold_alarm_threads_running`,`alarm_used_memory_status`,`threshold_warning_used_memory`)
69 | VALUES (1,'192.168.176.27','Redis测试','hechunyang123456',6379,1,1,'hechunyang@126.com',1,'hechunyang',NULL,150,NULL,'200M');
70 |
71 | 注,以下字段可以按照需求变更:
72 |
73 | ip字段含义:输入被监控Redis的IP地址
74 |
75 | tag字段含义:输入被监控Redis的业务名字
76 |
77 | pwd字段含义:输入被监控Redis的密码
78 |
79 | port字段含义:输入被监控Redis的端口号
80 |
81 | monitor字段含义:0为关闭监控(也不采集数据,直接跳过);1为开启监控(采集数据)
82 |
83 | send_mail字段含义:0为关闭邮件报警;1为开启邮件报警
84 |
85 | send_mail_to_list字段含义:邮件人列表
86 |
87 | send_weixin字段含义:0为关闭微信报警;1为开启微信报警
88 |
89 | send_weixin_to_list字段含义:微信公众号
90 |
91 | threshold_alarm_threads_running字段含义:设置连接数阀值(单位个)
92 |
93 | threshold_warning_used_memory字段含义:设置已用内存报警阀值(单位M)
94 |
95 | ### 3、修改conn.php配置文件
96 |
97 | vim /var/www/html/redis_monitor/conn.php
98 |
99 | $con = mysqli_connect("127.0.0.1","admin","hechunyang","redis_monitor","3306") or die("数据库链接错误".mysqli_error());
100 |
101 | 改成你的Redis Monitor监控工具表结构(redis_monitor库)连接信息
102 |
103 | ### 4、修改邮件报警信息
104 |
105 | cd /var/www/html/redis_monitor/mail/
106 |
107 | vim mail.php
108 |
109 | system("./mail/sendEmail -f chunyang_he@139.com -t '{$this->send_mail_to_list}' -s
110 | smtp.139.com:25 -u '{$this->alarm_subject}' -o message-charset=utf8 -o message-content-type=html -m '报警信息:
{$this->alarm_info}' -xu chunyang_he@139.com -xp
112 | '123456' -o tls=no");
113 |
114 | 改成你的发件人地址,账号密码,里面的变量不用修改。
115 |
116 |
117 | ### 5、修改微信报警信息
118 |
119 | cd /var/www/html/redis_monitor/weixin/
120 |
121 | vim wechat.py
122 |
123 | 微信企业号设置移步
124 |
125 | https://github.com/X-Mars/Zabbix-Alert-WeChat/blob/master/README.md 看此教程配置。
126 |
127 | ### 6、定时任务每分钟抓取一次
128 |
129 | # crontab -l
130 | */1 * * * * /usr/bin/php /var/www/html/redis_monitor/check_redis_status.php > /dev/null 2 >&1
131 | ##### check_redis_status.php(用来采集被监控端Redis状态信息和触发报警)
132 |
133 | ### 7、更改页面自动刷新频率
134 |
135 | vim redis_status_monitor.php
136 |
137 | http-equiv="refresh" content="600"
138 |
139 | 默认页面每600秒自动刷新一次。
140 |
141 |
142 | ### 8、页面访问
143 |
144 | http://yourIP/redis_monitor/redis_status_monitor.php
145 |
146 | 加一个超链接,可方便地接入你们的自动化运维平台里。
147 |
--------------------------------------------------------------------------------
/conn.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
--------------------------------------------------------------------------------
/db_connect_graph_getdata.php:
--------------------------------------------------------------------------------
1 | =${interval_time} AND create_time <=NOW() group by FLOOR(UNIX_TIMESTAMP(create_time)/60)";
19 |
20 | $result1 = mysqli_query($con,$get_info);
21 | //echo $get_info;
22 |
23 | $array= array();
24 | class Connections{
25 | public $create_time;
26 | public $threads_connected;
27 | }
28 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){
29 | $cons=new Connections();
30 | $cons->create_time = $row['create_time'];
31 | //$user->user_max = $row['user_max'];
32 | $cons->threads_connected = $row['threads_connected'];
33 | $array[]=$cons;
34 | }
35 | $top_data=json_encode($array);
36 | // echo "{".'"user"'.":".$data."}";
37 | echo $top_data;
38 | }
39 |
40 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main';
41 | if (function_exists($fn)) {
42 | call_user_func($fn);
43 | }
44 | */
45 |
46 | $ip = $_GET['ip'];
47 | $tag = $_GET['tag'];
48 | $port = $_GET['port'];
49 | $interval_time = $_GET['interval_time'];
50 |
51 | index($ip,$tag,$port,$interval_time);
52 |
53 |
54 | ?>
55 |
56 |
--------------------------------------------------------------------------------
/db_memory_graph_getdata.php:
--------------------------------------------------------------------------------
1 | =${interval_time} AND create_time <=NOW() group by FLOOR(UNIX_TIMESTAMP(create_time)/60)";
19 | $result1 = mysqli_query($con,$get_info);
20 | //echo $get_info;
21 |
22 | $array=array();
23 | class UsingIndex{
24 | public $create_time;
25 | public $used_memory_rss_human;
26 | public $used_memory_peak_human;
27 | }
28 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){
29 | $cons=new UsingIndex();
30 | $cons->create_time = $row['create_time'];
31 | $cons->used_memory_rss_human = $row['used_memory_rss_human'];
32 | $cons->used_memory_peak_human = $row['used_memory_peak_human'];
33 | $array[]=$cons;
34 | }
35 | $top_data=json_encode($array);
36 | // echo "{".'"user"'.":".$data."}";
37 | echo $top_data;
38 | }
39 |
40 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main';
41 | if (function_exists($fn)) {
42 | call_user_func($fn);
43 | }
44 | */
45 |
46 | $ip = $_GET['ip'];
47 | $tag = $_GET['tag'];
48 | $port = $_GET['port'];
49 | $interval_time = $_GET['interval_time'];
50 |
51 | index($ip,$tag,$port,$interval_time);
52 |
53 |
54 | ?>
55 |
56 |
--------------------------------------------------------------------------------
/db_qps_graph_getdata.php:
--------------------------------------------------------------------------------
1 | =${interval_time} AND create_time <=NOW() group by FLOOR(UNIX_TIMESTAMP(create_time)/60)";
21 | $result1 = mysqli_query($con,$get_info);
22 | //echo $get_info;
23 |
24 | $array= array();
25 | class Connections{
26 | public $create_time;
27 | public $qps;
28 | }
29 | while($row = mysqli_fetch_array($result1,MYSQLI_ASSOC)){
30 | $cons=new Connections();
31 | $cons->create_time = $row['create_time'];
32 | $cons->qps = $row['qps'];
33 | $array[]=$cons;
34 | }
35 | $top_data=json_encode($array);
36 | // echo "{".'"user"'.":".$data."}";
37 | echo $top_data;
38 | }
39 |
40 | /*$fn = isset($_GET['fn']) ? $_GET['fn'] : 'main';
41 | if (function_exists($fn)) {
42 | call_user_func($fn);
43 | }
44 | */
45 |
46 | $ip = $_GET['ip'];
47 | $tag = $_GET['tag'];
48 | $port = $_GET['port'];
49 | $interval_time = $_GET['interval_time'];
50 |
51 | index($ip,$tag,$port,$interval_time);
52 |
53 |
54 | ?>
55 |
56 |
--------------------------------------------------------------------------------
/image/chart.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/chart.gif
--------------------------------------------------------------------------------
/image/redis_monitor.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/redis_monitor.jpg
--------------------------------------------------------------------------------
/image/redis_monitor_history1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/redis_monitor_history1.png
--------------------------------------------------------------------------------
/image/redis_monitor_history2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/redis_monitor_history2.png
--------------------------------------------------------------------------------
/image/redis_monitor_history3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/redis_monitor_history3.png
--------------------------------------------------------------------------------
/image/redis_slowlog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/redis_slowlog.png
--------------------------------------------------------------------------------
/image/table_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hcymysql/redis_monitor/eb8312f0427b408adb9d5cfd7d7389fdfc4884d3/image/table_info.png
--------------------------------------------------------------------------------
/js/shine.js:
--------------------------------------------------------------------------------
1 | (function (root, factory) {if (typeof define === 'function' && define.amd) {
2 | // AMD. Register as an anonymous module.
3 | define(['exports', 'echarts'], factory);
4 | } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
5 | // CommonJS
6 | factory(exports, require('echarts'));
7 | } else {
8 | // Browser globals
9 | factory({}, root.echarts);
10 | }
11 | }(this, function (exports, echarts) {
12 | var log = function (msg) {
13 | if (typeof console !== 'undefined') {
14 | console && console.error && console.error(msg);
15 | }
16 | };
17 | if (!echarts) {
18 | log('ECharts is not Loaded');
19 | return;
20 | }
21 |
22 | var colorPalette = [
23 | '#c12e34','#e6b600','#0098d9','#2b821d',
24 | '#005eaa','#339ca8','#cda819','#32a487'
25 | ];
26 |
27 | var theme = {
28 |
29 | color: colorPalette,
30 |
31 | title: {
32 | textStyle: {
33 | fontWeight: 'normal'
34 | }
35 | },
36 |
37 | visualMap: {
38 | color:['#1790cf','#a2d4e6']
39 | },
40 |
41 | toolbox: {
42 | iconStyle: {
43 | normal: {
44 | borderColor: '#06467c'
45 | }
46 | }
47 | },
48 |
49 | tooltip: {
50 | backgroundColor: 'rgba(0,0,0,0.6)'
51 | },
52 |
53 | dataZoom: {
54 | dataBackgroundColor: '#dedede',
55 | fillerColor: 'rgba(154,217,247,0.2)',
56 | handleColor: '#005eaa'
57 | },
58 |
59 | timeline: {
60 | lineStyle: {
61 | color: '#005eaa'
62 | },
63 | controlStyle: {
64 | normal: {
65 | color: '#005eaa',
66 | borderColor: '#005eaa'
67 | }
68 | }
69 | },
70 |
71 | candlestick: {
72 | itemStyle: {
73 | normal: {
74 | color: '#c12e34',
75 | color0: '#2b821d',
76 | lineStyle: {
77 | width: 1,
78 | color: '#c12e34',
79 | color0: '#2b821d'
80 | }
81 | }
82 | }
83 | },
84 |
85 | graph: {
86 | color: colorPalette
87 | },
88 |
89 | map: {
90 | label: {
91 | normal: {
92 | textStyle: {
93 | color: '#c12e34'
94 | }
95 | },
96 | emphasis: {
97 | textStyle: {
98 | color: '#c12e34'
99 | }
100 | }
101 | },
102 | itemStyle: {
103 | normal: {
104 | borderColor: '#eee',
105 | areaColor: '#ddd'
106 | },
107 | emphasis: {
108 | areaColor: '#e6b600'
109 | }
110 | }
111 | },
112 |
113 | gauge: {
114 | axisLine: {
115 | show: true,
116 | lineStyle: {
117 | color: [[0.2, '#2b821d'],[0.8, '#005eaa'],[1, '#c12e34']],
118 | width: 5
119 | }
120 | },
121 | axisTick: {
122 | splitNumber: 10,
123 | length:8,
124 | lineStyle: {
125 | color: 'auto'
126 | }
127 | },
128 | axisLabel: {
129 | textStyle: {
130 | color: 'auto'
131 | }
132 | },
133 | splitLine: {
134 | length: 12,
135 | lineStyle: {
136 | color: 'auto'
137 | }
138 | },
139 | pointer: {
140 | length: '90%',
141 | width: 3,
142 | color: 'auto'
143 | },
144 | title: {
145 | textStyle: {
146 | color: '#333'
147 | }
148 | },
149 | detail: {
150 | textStyle: {
151 | color: 'auto'
152 | }
153 | }
154 | }
155 | };
156 | echarts.registerTheme('shine', theme);
157 | }));
--------------------------------------------------------------------------------
/js/show_connect.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
103 |
--------------------------------------------------------------------------------
/js/show_graph_index.php:
--------------------------------------------------------------------------------
1 |
7 |
115 |
--------------------------------------------------------------------------------
/js/show_graph_qps.php:
--------------------------------------------------------------------------------
1 |
7 |
8 |
103 |
--------------------------------------------------------------------------------
/js/show_used_memory.php:
--------------------------------------------------------------------------------
1 |
7 |
115 |
--------------------------------------------------------------------------------
/mail/mail.php:
--------------------------------------------------------------------------------
1 | send_mail_to_list = $send_mail_to_list;
10 | $this->alarm_subject = $alarm_subject;
11 | $this->alarm_info = $alarm_info;
12 | }
13 |
14 | function execCommand(){
15 | echo $this->alarm_subject."\n";
16 | echo $this->alarm_info."\n";
17 | 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 '报警信息:
{$this->alarm_info}' -xu chunyang_he@139.com -xp '123456' -o tls=no");
18 | }
19 | }
20 |
21 | ?>
22 |
--------------------------------------------------------------------------------
/redis_status_monitor.php:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
"; 169 | 170 | if(isset($_POST['submit'])){ 171 | $tag=$_POST['tag']; 172 | $dbip=$_POST['dbip']; 173 | $dbport=$_POST['dbport']; 174 | $dbrole=$_POST['dbrole']; 175 | $alive=$_POST['alive']; 176 | //session_start(); 177 | //$_SESSION['transmit_tag']=$tag; 178 | //require 'show.html'; 179 | } else { 180 | //require 'top.html'; 181 | } 182 | 183 | ?> 184 | 185 |
基本信息 | 188 |线程/会话 | 189 |内存 | 190 |性能 | 191 |
主机 | 198 |数据库标签 | 199 |端口 | 200 |角色 | 201 |状态 | 202 |运行模式 | 203 |版本 | 204 |运行时间 | 205 |开启AOF | 206 |最大连接数 | 207 |当前连接数 | 208 |被阻塞连接数 | 209 |被拒绝连接数 | 210 |最大内存 | 211 |已经使用内存 | 212 |内存消耗峰值 | 213 |同步延迟 | 214 |每秒QPS | 215 |图表 | 216 |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{$row['host']} | "; 272 | echo "{$row['tag']} | "; 273 | echo "{$row['port']} | "; 274 | //echo "{$row['port']} | "; 275 | echo "{$role} | "; 276 | echo "{$status} | "; 277 | echo "{$row['mode']} | "; 278 | echo "{$row['db_version']} | "; 279 | echo "{$row['runtime']}天 | "; 280 | echo "{$row['aof_enabled']} | "; 281 | echo "{$row['max_connections']} | "; 282 | if ($row['alarm_threads_running'] == 1){ 283 | echo "{$row['threads_connected']} | "; 284 | } else { 285 | echo "{$row['threads_connected']} | "; 286 | } 287 | echo "{$row['blocked_connected']} | "; 288 | echo "{$row['rejected_connected']} | "; 289 | //echo "{$row['7']} | "; 290 | echo "{$row['maxmemory_human']} | "; 291 | if ($row['alarm_used_memory_status'] == 1){ 292 | echo "{$row['used_memory_rss_human']} | "; 293 | } else { 294 | echo "{$row['used_memory_rss_human']} | "; 295 | } 296 | echo "{$row['used_memory_peak_human']} | "; 297 | echo "{$row['Seconds_Behind_Master']} | "; 298 | echo "{$row['qps']} | "; 299 | echo "![]() | ";
300 | echo "
第一页 | "; 329 | $htmlstr.="上一页 | "; 330 | } 331 | 332 | $htmlstr.="总共${totalPage}页 | "; 333 | 334 | for ($i=$startPage;$i<=$endPage; $i++){ 335 | 336 | $htmlstr.="" . $i . " | "; 337 | } 338 | 339 | if ($page<$totalPage){ 340 | $htmlstr.="下一页 | "; 341 | $htmlstr.="最后页 | "; 342 | 343 | } 344 | $htmlstr.="
27 | 31 | | 32 | 33 |34 | 38 | | 39 | 40 |41 | 45 | | 46 | 47 |48 | 52 | | 53 | 54 |55 | 59 | | 60 | 61 |62 | 66 | | 67 | 68 |69 | 73 | | 74 | 75 |
命令执行时的时间 | 63 |命令消耗的时间 | 64 |执行的命令 | 65 |客户端地址和端口 | 66 |
---|---|---|---|
".$exec_time." | "; 93 | echo "".$slow_time."(单位毫秒)"." | "; 94 | echo "";
95 | foreach ($slow_cmd as $cmd){
96 | echo $cmd." "; 97 | } 98 | echo " | ";
99 | echo "".$client_info." | "; 100 | echo "
")}}),e(n).parents("form").on("submit",function(){var t=c.html();8==l.ie&&(t=t.replace(/<.+>/g,function(t){return t.toLowerCase()})),n.value=t}),c.on("paste",function(e){r.execCommand("formatBlock",!1,"
"),setTimeout(function(){f.call(t,c),n.value=c.html()},100)})},f=function(t){var i=this;i.document;t.find("*[style]").each(function(){var t=this.style.textAlign;this.removeAttribute("style"),e(this).css({"text-align":t||""})}),t.find("table").addClass("layui-table"),t.find("script,link").remove()},m=function(t){return t.selection?t.selection.createRange():t.getSelection().getRangeAt(0)},p=function(t){return t.endContainer||t.parentElement().childNodes[0]},v=function(t,i,a){var l=this.document,n=document.createElement(t);for(var o in i)n.setAttribute(o,i[o]);if(n.removeAttribute("text"),l.selection){var r=a.text||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.pasteHTML(e(n).prop("outerHTML")),a.select()}else{var r=a.toString()||i.text;if("a"===t&&!r)return;r&&(n.innerHTML=r),a.deleteContents(),a.insertNode(n)}},h=function(t,i){var a=this.document,l="layedit-tool-active",n=p(m(a)),o=function(e){return t.find(".layedit-tool-"+e)};i&&i[i.hasClass(l)?"removeClass":"addClass"](l),t.find(">i").removeClass(l),o("unlink").addClass(r),e(n).parents().each(function(){var t=this.tagName.toLowerCase(),e=this.style.textAlign;"b"!==t&&"strong"!==t||o("b").addClass(l),"i"!==t&&"em"!==t||o("i").addClass(l),"u"===t&&o("u").addClass(l),"strike"===t&&o("d").addClass(l),"p"===t&&("center"===e?o("center").addClass(l):"right"===e?o("right").addClass(l):o("left").addClass(l)),"a"===t&&(o("link").addClass(l),o("unlink").removeClass(r))})},g=function(t,a,l){var n=t.document,o=e(n.body),c={link:function(i){var a=p(i),l=e(a).parent();b.call(o,{href:l.attr("href"),target:l.attr("target")},function(e){var a=l[0];"A"===a.tagName?a.href=e.url:v.call(t,"a",{target:e.target,href:e.url,text:e.url},i)})},unlink:function(t){n.execCommand("unlink")},face:function(e){x.call(this,function(i){v.call(t,"img",{src:i.src,alt:i.alt},e)})},image:function(a){var n=this;layui.use("upload",function(o){var r=l.uploadImage||{};o.render({url:r.url,method:r.type,elem:e(n).find("input")[0],done:function(e){0==e.code?(e.data=e.data||{},v.call(t,"img",{src:e.data.src,alt:e.data.title},a)):i.msg(e.msg||"上传失败")}})})},code:function(e){k.call(o,function(i){v.call(t,"pre",{text:i.code,"lay-lang":i.lang},e)})},help:function(){i.open({type:2,title:"帮助",area:["600px","380px"],shadeClose:!0,shade:.1,skin:"layui-layer-msg",content:["http://www.layui.com/about/layedit/help.html","no"]})}},s=a.find(".layui-layedit-tool"),u=function(){var i=e(this),a=i.attr("layedit-event"),l=i.attr("lay-command");if(!i.hasClass(r)){o.focus();var u=m(n);u.commonAncestorContainer;l?(n.execCommand(l),/justifyLeft|justifyCenter|justifyRight/.test(l)&&n.execCommand("formatBlock",!1,"
"),setTimeout(function(){o.focus()},10)):c[a]&&c[a].call(this,u),h.call(t,s,i)}},d=/image/;s.find(">i").on("mousedown",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)||u.call(this)}).on("click",function(){var t=e(this),i=t.attr("layedit-event");d.test(i)&&u.call(this)}),o.on("click",function(){h.call(t,s),i.close(x.index)})},b=function(t,e){var l=this,n=i.open({type:1,id:"LAY_layedit_link",area:"350px",shade:.05,shadeClose:!0,moveType:1,title:"超链接",skin:"layui-layer-msg",content:['