linux下用watch工具来监控Mysql_Linux教程
其实很简单,就是利用linux下的 watch 工具来做监控,方法如下:
[yejr@localhost imysql]# watch -d -n 10 "egrep 'MySQL thread|Log|Modified db pages' innodb_status.3249 "
Every 10.0s: egrep 'MySQL thread|Log|Modified db pages' innodb_status.3249 Thu Apr 9 10:01:12 2009
MySQL thread id 6, query id 71 localhost root Sending data
Log sequence number 2703 3443241402
Log flushed up to 2703 3442763607
Modified db pages 83325
或者:
[yejr@localhost imysql]#watch -d -n 10 "mysqladmin ext|egrep Innodb_data"
Every 10.0s: mysqladmin ext|egrep Innodb_data Thu Apr 9 10:03:55 2009
| Innodb_data_fsyncs | 4144699 |
| Innodb_data_pending_fsyncs | 0 |
| Innodb_data_pending_reads | 0 |
| Innodb_data_pending_writes | 0 |
| Innodb_data_read | 5567172608 |
| Innodb_data_reads | 298413 |
| Innodb_data_writes | 4492881 |
| Innodb_data_written | 18549422080 |
参数解释:
-d --differences
-n --interval
不用我多说了吧,怎么样,是不是觉得很有意思呢 :)
- 相关链接:
- 教程说明:
Linux教程-linux下用watch工具来监控Mysql。