【MySQL】数据库监控(Nagios)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了【MySQL】数据库监控(Nagios),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4538字,纯文字阅读大概需要7分钟。
内容图文
[root@wallet03 ~]# yum install -y perl-DBI perl-DBD-MySQL [root@wallet03 ~]# tar zxvf check_mysql_health-2.2.2.tar.gz [root@wallet03 ~]# cd check_mysql_health-2.2.2 [root@wallet03 check_mysql_health-2.2.2]# ./configure --prefix=/usr/local/nagios \ --with-nagios-user=nagios \ --with-nagios-group=nagios [root@wallet03 check_mysql_health-2.2.2]# make [root@wallet03 check_mysql_health-2.2.2]# make install [root@wallet03 ~]# cd /usr/local/nagios/libexec/ [root@wallet03 libexec]# ./check_mysql_health Please select a mode Copyright (c) 2009 Gerhard Lausser Check various parameters of MySQL databases Usage: check_mysql_health [-v] [-t <timeout>] [[--hostname <hostname>] [--port <port> | --socket <socket>] --username <username> --password <password>] --mode <mode> [--method mysql] [root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.1.202 --username nagios --password nagios --mode connection-time OK - 0.02 seconds to connect as nagios | connection_time=0.0169s;1;5 [root@wallet03 libexec]# ./check_mysql_health --hostname 192.168.1.202 --username nagios --password nagios --mode uptime OK - database is up since 7542 minutes | uptime=452541s [root@wallet03 ~]# cd /usr/local/nagios/etc/objects [root@wallet03 objects]# vi commands.cfg define command{ command_name check_mysql command_line $USER1$/check_mysql_health --hostname $ARG1$ --username nagios --password nagios --mode $ARG2$ } [root@wallet03 objects]# vi mysql.cfg define host{ use linux-server host_name wallet01 alias wallet01 icon_image redhat.gif statusmap_image redhat.gd2 address 192.168.1.202 } define hostgroup{ hostgroup_name database alias database members wallet02 } define service{ host_name wallet02 use generic-service service_description mysql connection time check_command check_mysql!192.168.1.202!connection-time } define service{ host_name wallet02 use generic-service service_description mysql uptime check_command check_mysql!192.168.1.202!uptime } define service{ host_name wallet02 use generic-service service_description mysql client-connected check_command check_mysql!192.168.1.202!threads-connected } define service{ host_name wallet02 use generic-service service_description mysql slow-queries check_command check_mysql!192.168.1.202!slow-queries } define service{ host_name wallet02 use generic-service service_description mysql tmp-disk-tables check_command check_mysql!192.168.1.202!tmp-disk-tables } define service{ host_name wallet02 use generic-service service_description mysql slave-lag check_command check_mysql!192.168.1.202!slave-lag } define service{ host_name wallet02 use generic-service service_description mysql slave-io-running check_command check_mysql!192.168.1.202!slave-io-running } define service{ host_name wallet02 use generic-service service_description mysql slave-sql-running check_command check_mysql!192.168.1.202!slave-sql-running } [root@wallet03 ~]# cd /usr/local/nagios/etc [root@wallet03 etc]# vi icinga.cfg cfg_file=/usr/local/nagios/etc/objects/mysql.cfg [root@wallet03 ~]# service icinga restart Running configuration check...OK Stopping Icinga: Waiting for icinga to exit ..Stopping icinga done. Starting icinga: Starting icinga done.
内容总结
以上是互联网集市为您收集整理的【MySQL】数据库监控(Nagios)全部内容,希望文章能够帮你解决【MySQL】数据库监控(Nagios)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。