偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Nagios監(jiān)控數據庫的方法

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

  Nagios監(jiān)控數據庫的方法:

  check_mysql_health監(jiān)控數據庫

  1、check_mysql_health安裝

  在監(jiān)控服務器上安裝

  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 狀態(tài)信息文件路徑  
  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節(jié)點運行狀況  
  78.  
  79.   sql 返回一個數字的任何SQL語句  
  80.  

  3、check_mysql_health監(jiān)控配置

  監(jiān)控服務器:10.59.97.42

  MySQL數據授權:

  在要監(jiān)控的MySQL數據庫服務器上

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

  在監(jiān)控服務器上

  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插件監(jiān)控數據庫

  一、安裝此插件

  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 統(tǒng)計連接到從主機數

  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系統(tǒng)免費短信報警配置

20分鐘內在Ubuntu上實現(xiàn)Nagios的主機監(jiān)控

Nagios監(jiān)控oracle

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

2011-03-24 10:59:09

Nagios監(jiān)控Mysql

2011-03-21 13:10:13

NagiosWindows

2011-03-24 10:08:39

Nagios監(jiān)控oracle

2011-03-04 10:47:06

Nagios監(jiān)控Sphinx

2011-03-28 17:18:57

nagios監(jiān)控iostat

2011-04-01 15:42:13

CactiNagios

2011-08-24 13:49:45

Access數據庫轉化

2011-03-21 14:53:27

Nagios監(jiān)控Linux

2014-04-09 11:43:54

Zabbix監(jiān)控Mysql數據庫

2010-10-26 11:04:48

oracle數據導入

2010-10-26 15:54:02

連接oracle數據庫

2011-03-21 13:10:15

Nagios監(jiān)控

2011-03-22 13:00:49

Nagios監(jiān)控

2011-03-23 10:17:24

2011-03-21 14:43:42

2011-03-22 09:07:12

nagios監(jiān)控oracle

2012-02-22 22:21:15

nagios開源

2011-03-04 11:18:15

Nagios監(jiān)控Sphinx

2011-03-21 15:42:14

LinuxNagios

2011-03-24 10:59:11

NagiosWindows監(jiān)控
點贊
收藏

51CTO技術棧公眾號