Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1154521
  • 博文数量: 150
  • 博客积分: 2739
  • 博客等级: 少校
  • 技术积分: 2392
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-07 12:28
文章分类

全部博文(150)

文章存档

2015年(2)

2014年(16)

2013年(10)

2012年(58)

2011年(64)

分类: LINUX

2011-12-23 14:59:51

Nagios监控mysql,是需要下载chech_mysql_health插件进行监控的,下载地址:
             

当然nagios监控Oracle、DB2等都可以在这个网站上找到,我也不多写了,上面写的挺清楚了。相信看了的人都会。

对PostgreSQL数据库的监控也是按照PostgreSQL插件,使用方法网站如下:

              
command.cfg定义:
########MYSQL##############
define command {
command_name check_mysql
command_line $USER1$/check_mysql -H $HOSTADDRESS$  -P $ARG1$ -u $ARG2$  -p $ARG3$
}


define command{
command_name check_mysql_health
command_line $USER1$/check_mysql_health -port $ARG1$ -hostname $ARG2$ -username $ARG3$ -password $ARG4$ -warning $ARG5$ -critical $ARG6$ -mode $ARG7$
}

主机定义:

define host{
         use            linux-server,host-pnp
        host_name       test
        alias           test
        address         192.168.2.30
        hostgroups      linux-servers
        }



#####################thread-connected##################################################
define service{
        use                             linux-service,srv-pnp
        host_name                       test
        service_description             threads-connected
        check_command                   check_mysql_health!3306!192.168.2.30!root!qwer1234!1000!1500!threads-connected
        }


#####################index-usage#########################################################

#define service{
#        use                             linux-service,srv-pnp
#        host_name                       test
#        service_description             index-usage
#        check_command                   check_mysql_health!3306!192.168.2.30!root!qwer1234!1000!1500!index-usage
#        }

#####################qcahe-hitrate########################################################

define service{
        use                             linux-service,srv-pnp
        host_name                       test
        service_description             qcahe-hitrate
        check_command                   check_mysql_health!3306!192.168.2.30!root!qwer1234!1000!1500!qcache-hitrate
        }


####################uptime###############################################################

define service{
        use                             linux-service,srv-pnp
        host_name                       test
        service_description             connect-time
        check_command                   check_mysql_health!3306!192.168.2.30!root!qwer1234!1000!1500!connection-time
        }

###################threadcache-hitrate############################################
阅读(31987) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~