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############################################
阅读(32050) | 评论(0) | 转发(0) |