成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

Nagios監控數據庫的方法

運維 系統運維
Nagios監控數據庫的方法:Nagios是一個監控系統運行狀態和網絡信息的監控系統。Nagios能監控所指定的本地或遠程主機以及服務,同時提供異常通知功能等。這篇文章講述的是Nagios監控數據庫的方法。

  Nagios監控數據庫的方法:

  check_mysql_health監控數據庫

  1、check_mysql_health安裝

  在監控服務器上安裝

  1.   # cd /usr/local/src/tarbag  
  2.  
  3.   # wget http://labs.consol.de/wp-content/uploads/2010/03/check_mysql_health-2.1.1.tar.gz  
  4.  
  5.   # tar zxvf check_mysql_health-2.1.1.tar.gz -C ../software/  
  6.  
  7.   # ./configure \  
  8.  
  9.   –prefix=/usr/local/nagios/ \  
  10.  
  11.   –with-nagios-user=nagios \  
  12.  
  13.   –with-nagios-group=nagios \  
  14.  
  15.   –with-perl=/usr/bin/perl \  
  16.  
  17.   –with-statefiles-dir=/usr/local/nagios/var/tmp \  
  18.  
  19.   –with-perl perl\ 程序運行路徑  
  20.  
  21.   –with-statefiles-dir 狀態信息文件路徑  
  22.  
  23.   # make  
  24.  
  25.   # make install  
  26.  

  2、check_mysql_health選項

  1.   Options:  
  2.  
  3.   –hostname  
  4.  
  5.   the database server’s hostname  
  6.  
  7.   –port  
  8.  
  9.   the database’s port. (default: 3306)  
  10.  
  11.   –socket  
  12.  
  13.   the database’s unix socket.  
  14.  
  15.   –username  
  16.  
  17.   the mysql db user  
  18.  
  19.   –password  
  20.  
  21.   the mysql db user’s password  
  22.  
  23.   –database  
  24.  
  25.   the database’s name. (default: information_schema)  
  26.  
  27.   –warning  
  28.  
  29.   the warning range  
  30.  
  31.   –critical  
  32.  
  33.   the critical range  
  34.  
  35.   –mode  
  36.  
  37.   the mode of the plugin. select one of the following keywords:  
  38.  
  39.   connection-time 連接到服務器上的時間  
  40.  
  41.   uptime 服務器運行的時間  
  42.  
  43.   threads-connected 當前連接到數據庫的連接數  
  44.  
  45.   threadcache-hitrate 線程緩存命中率  
  46.  
  47.   slave-lag slave落后master多少時間  
  48.  
  49.   slave-io-running slave復制是否正常  
  50.  
  51.   slave-sql-running slave復制是否正常  
  52.  
  53.   qcache-hitrate 查詢緩存命中率  
  54.  
  55.   qcache-lowmem-prunes (Query cache entries pruned because of low memory)  
  56.  
  57.   keycache-hitrate (MyISAM key cache hitrate)  
  58.  
  59.   bufferpool-hitrate (InnoDB buffer pool hitrate)  
  60.  
  61.   bufferpool-wait-free (InnoDB buffer pool waits for clean page available)  
  62.  
  63.   log-waits (InnoDB log waits because of a too small log buffer)  
  64.  
  65.   tablecache-hitrate 表緩存命中率  
  66.  
  67.   table-lock-contention 表鎖率  
  68.  
  69.   index-usage 索引使用情況  
  70.  
  71.   tmp-disk-tables (Percent of temp tables created on disk)  
  72.  
  73.   slow-queries 慢查詢  
  74.  
  75.   long-running-procs 長時間運行的進程  
  76.  
  77.   cluster-ndbd-running ndb節點運行狀況  
  78.  
  79.   sql 返回一個數字的任何SQL語句  
  80.  

  3、check_mysql_health監控配置

  監控服務器:10.59.97.42

  MySQL數據授權:

  在要監控的MySQL數據庫服務器上

  1.   mysql> grant usage on *.* to honyho@10.59.97.42 identified by “honyho@8123“;  
  2.  
  3.   mysql> flush privileges;  
  4.  

  在監控服務器上

  1》查看當前連接到數據庫的連接數

  1.   #./check_mysql_health –hostname 10.59.97.57 –username honyho –password honyho@8123 –mode threads-connected  
  2.  
  3.   OK – 3 client connection threads | threads_connected=3;10;20  
  4.  
  5.   threads_connected=3;10;20  
  6.  

  3表示連接數

  10 表示warning閥值(默認)

  20 表示critical閥值(默認)

#p#

  Nagios相關配置

  1》配置commands.cfg文件

  1.   define command{  
  2.  
  3.   command_name check_mysql_health  
  4.  
  5.   command_line $USER1$/check_mysql_health –hostname $ARG1$ –username $ARG2$ –password $ARG3$ –warning $ARG4$ –critical $ARG5$ –mode $ARG6$  
  6.  
  7.   }  
  8.  

  2》配置121_207_231_17.cfg文件

  1.   define service{  
  2.  
  3.   use local-service  
  4.  
  5.   host_name 121.207.231.17  
  6.  
  7.   service_description threads-connected  
  8.  
  9.   check_command check_mysql_health!10.59.97.57!honyho!honyho@8123!1000!1500!threads-connected  
  10.  
  11.   }  
  12.  

  ———————————————————–

#p#

  nagios-mysql-plugins插件監控數據庫

  一、安裝此插件

  1.   #wget 北北沒有給地址  
  2.  
  3.   #tar zxvf nagios-mysql-plugins-0.3.tar.gz -C ../software/  
  4.  
  5.   #cd nagios-mysql-plugins-0.3  
  6.  
  7.   #chmod +x *mysql*  
  8.  

  二、插件內容

  check_db_mysql.pl 檢測mysql是否運行

  check_errorlog_mysql.pl 檢測mysql數據庫錯誤日志

  check_repl_mysql_cnt_slave_hosts.pl 統計連接到從主機數

  check_repl_mysql_heartbeat.pl 檢測心跳 (安裝完默認名字是check_repl_mysql_hearbeat.pl)

  check_repl_mysql_io_thread.pl 檢測IO線程

  check_repl_mysql_read_exec_pos.pl

  check_repl_mysql_readonly.pl 檢測從是否設置為只讀

  check_repl_mysql_seconds_behind_master.pl檢測從多少時間與主同步

  check_repl_mysql_sql_thread.pl 檢測SQL線程

  perf_mysql.pl 收集性能數據

  1.   perf_mysql.pl -m  
  2.  
  3.   connections,  
  4.  
  5.   thread_cache,  
  6.  
  7.   network_traffic,  
  8.  
  9.   queries,query_cache,  
  10.  
  11.   myisam_key_buffer,  
  12.  
  13.   table_cache,  
  14.  
  15.   temporary_tables,  
  16.  
  17.   tables,  
  18.  
  19.   slow_queries,  
  20.  
  21.   bin_log,uptime,  
  22.  
  23.   innodb_buffer_pool,  
  24.  
  25.   innodb_buffer_pool_io,  
  26.  
  27.   innodb_io,innodb_data,  
  28.  
  29.   innodb_logfile,  
  30.  
  31.   innodb_row_locking,  
  32.  
  33.   innodb_queries  

【編輯推薦】

Nagios飛信Linux系統免費短信報警配置

20分鐘內在Ubuntu上實現Nagios的主機監控

Nagios監控oracle

責任編輯:zhaolei 來源: nagiostutorial
相關推薦

2011-03-24 10:59:09

Nagios監控Mysql

2011-03-21 13:10:13

NagiosWindows

2011-03-24 10:08:39

Nagios監控oracle

2011-03-04 10:47:06

Nagios監控Sphinx

2011-03-28 17:18:57

nagios監控iostat

2011-04-01 15:42:13

CactiNagios

2011-03-21 14:53:27

Nagios監控Linux

2011-08-24 13:49:45

Access數據庫轉化

2014-04-09 11:43:54

Zabbix監控Mysql數據庫

2011-03-21 14:43:42

2011-03-22 09:07:12

nagios監控oracle

2012-02-22 22:21:15

nagios開源

2011-03-21 13:10:15

Nagios監控

2011-03-22 13:00:49

Nagios監控

2011-03-23 10:17:24

2010-10-26 11:04:48

oracle數據導入

2011-03-04 11:18:15

Nagios監控Sphinx

2011-03-21 15:42:14

LinuxNagios

2011-03-24 10:59:11

NagiosWindows監控

2011-03-25 15:37:17

Solarisnagios
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 一区二区高清 | 日韩中文在线视频 | 粉嫩粉嫩芽的虎白女18在线视频 | 欧美激情在线精品一区二区三区 | 给我免费的视频在线观看 | 久久久久国产精品一区 | 中文字幕精品一区久久久久 | 国产精品96久久久久久 | 久久综合久久自在自线精品自 | 狠狠插狠狠操 | 热久久久久 | 国产最新精品视频 | 99re国产视频| av日韩在线播放 | 久久免费电影 | 国产1区2区3区 | 欧美日韩精品国产 | 欧美日韩综合一区 | 亚洲激情综合 | 91精品国产91久久久久久丝袜 | 国产成人精品综合 | 羞羞视频在线观免费观看 | 国产日韩一区二区 | 久久久久国产一区二区三区 | 国产一区二区在线播放 | 色一情一乱一伦一区二区三区 | 国产在线二区 | 成人在线视频网站 | 国产一区二区三区不卡av | 99reav| 精品视频在线观看 | 日韩精品一区二区三区 | av手机在线播放 | 成人免费精品视频 | 国产午夜亚洲精品不卡 | 免费观看一级特黄欧美大片 | 激情欧美一区二区三区 | 亚洲区一区二 | 91视频18| 久久久久久久久久久久亚洲 | 中文字幕伊人 |