Nagios监控数据库的方法
来源:互联网 发布:java同时定义多个变量 编辑:程序博客网 时间:2024/05/22 10:23
Nagios监控数据库的方法:
check_mysql_health监控数据库
1、check_mysql_health安装
在监控服务器上安装
- # cd /usr/local/src/tarbag
- # wget http://labs.consol.de/wp-content/uploads/2010/03/check_mysql_health-2.1.1.tar.gz
- # tar zxvf check_mysql_health-2.1.1.tar.gz -C ../software/
- # ./configure \
- –prefix=/usr/local/nagios/ \
- –with-nagios-user=nagios \
- –with-nagios-group=nagios \
- –with-perl=/usr/bin/perl \
- –with-statefiles-dir=/usr/local/nagios/var/tmp \
- –with-perl perl\ 程序运行路径
- –with-statefiles-dir 状态信息文件路径
- # make
- # make install
2、check_mysql_health选项
- Options:
- –hostname
- the database server’s hostname
- –port
- the database’s port. (default: 3306)
- –socket
- the database’s unix socket.
- –username
- the mysql db user
- –password
- the mysql db user’s password
- –database
- the database’s name. (default: information_schema)
- –warning
- the warning range
- –critical
- the critical range
- –mode
- the mode of the plugin. select one of the following keywords:
- connection-time 连接到服务器上的时间
- uptime 服务器运行的时间
- threads-connected 当前连接到数据库的连接数
- threadcache-hitrate 线程缓存命中率
- slave-lag slave落后master多少时间
- slave-io-running slave复制是否正常
- slave-sql-running slave复制是否正常
- qcache-hitrate 查询缓存命中率
- qcache-lowmem-prunes (Query cache entries pruned because of low memory)
- keycache-hitrate (MyISAM key cache hitrate)
- bufferpool-hitrate (InnoDB buffer pool hitrate)
- bufferpool-wait-free (InnoDB buffer pool waits for clean page available)
- log-waits (InnoDB log waits because of a too small log buffer)
- tablecache-hitrate 表缓存命中率
- table-lock-contention 表锁率
- index-usage 索引使用情况
- tmp-disk-tables (Percent of temp tables created on disk)
- slow-queries 慢查询
- long-running-procs 长时间运行的进程
- cluster-ndbd-running ndb节点运行状况
- sql 返回一个数字的任何SQL语句
3、check_mysql_health监控配置
监控服务器:10.59.97.42
MySQL数据授权:
在要监控的MySQL数据库服务器上
- mysql> grant usage on *.* to honyho@10.59.97.42 identified by “honyho@8123“;
- mysql> flush privileges;
在监控服务器上
1》查看当前连接到数据库的连接数
- #./check_mysql_health –hostname 10.59.97.57 –username honyho –password honyho@8123 –mode threads-connected
- OK – 3 client connection threads | threads_connected=3;10;20
- threads_connected=3;10;20
3表示连接数
10 表示warning阀值(默认)
20 表示critical阀值(默认)
Nagios相关配置
1》配置commands.cfg文件
- define command{
- command_name check_mysql_health
- command_line $USER1$/check_mysql_health –hostname $ARG1$ –username $ARG2$ –password $ARG3$ –warning $ARG4$ –critical $ARG5$ –mode $ARG6$
- }
2》配置121_207_231_17.cfg文件
- define service{
- use local-service
- host_name 121.207.231.17
- service_description threads-connected
- check_command check_mysql_health!10.59.97.57!honyho!honyho@8123!1000!1500!threads-connected
- }
0 0
- Nagios监控数据库的方法
- Nagios监控数据库的方法
- nagios监控网址流量的方法
- nagios的多层监控
- Nagios的监控原理
- nagios监控mysql数据库性能
- memcached监控的几种方法(nagios等)
- memcached监控的几种方法(nagios等)
- nagios对linux的监控
- 监控神器 nagios的安装
- nagios对window的监控
- nagios监控端的安装
- 监控系统nagios的安装
- nagios监控服务器的搭建
- nagios 监控内存-增加新插件方法
- nagios 监控内存-增加新插件方法
- nagios监控
- Nagios 监控
- STL源码解析-01stl配置文件
- 黑马程序员—C重点--结构体
- mongodb数据库的备份与恢复
- HDU 2544
- SQL Server 2012 SQLEXPRESS 127.0.0.1(IP地址方式)无法连接访问问题的解决
- Nagios监控数据库的方法
- 使用ThinkPHP框架快速搭建网站
- Android DrawerLayout 高仿QQ5.2双向侧滑菜单
- Mesh Baker的基本操作与功能演示(降低Draw call)
- iOS使用矢量图的总结
- Linux 网络配置 修改DNS配置文件/etc/resolv.conf后,重启网络,DNS配置丢失
- LibGdx UI编辑器 OverLap2D 学习(2) 学习UI使用,通过Button学习
- Volley学习(适合新手)
- mongodb 备份 还原 导出 导入