linux下用watch工具來監控Mysql_Linux教程

      編輯Tag賺U幣
      教程Tag:監控工具添加

      其實很簡單,就是利用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教程/更新時間:2011-12-08
      相關Linux教程