Hello,
I'm new to Incinga2 and try to setup mysql replication monitoring on the
slave machine. My OS is Debian/Wheezy with Incinga2 Version: r2.1.1-1
from wheezy-backports.
While learning docs I created following
file: /etc/icinga2/conf.d/hosts/localhost/mysql-slave.conf (see bellow).
However if I stop slave manually - I get no notifications from icinga2.
Only if I change vars.mysql_user to something non-existent - only then
icinga complains and notifies me. This doesn't happen even if I change
mysql_password to something wrong...
If I run the check manually from command line:
/usr/lib/nagios/plugins/check_mysql -u repl --password='my_password'
--check-slave
I get proper message on the CLI in both cases when replication runs (OK)
and when it doesn't (Failure)...
1. What is wrong with my configuration?
2. Is there a better/standard way to monitor mysql replication?
Thank you!
---------------------------------
// custom mysql replication check
object CheckCommand "my-mysql" {
import "plugin-check-command"
command = [ PluginDir + "/check_mysql" ] //constants.conf -> const
PluginDir
arguments = {
"-H" = "$mysql_host$"
"-u" = {
required = true
value = "$mysql_user$"
}
"-p" = "$mysql_password$"
"-P" = "$mysql_port$"
"-s" = "$mysql_socket$"
"-a" = "$mysql_cert$"
"-d" = "$mysql_database$"
"-k" = "$mysql_key$"
"-C" = "$mysql_ca_cert$"
"-D" = "$mysql_ca_dir$"
"-L" = "$mysql_ciphers$"
"-f" = "$mysql_optfile$"
"-g" = "$mysql_group$"
"-S" = {
set_if = "$mysql_check_slave$"
description = "Check if the slave thread is running properly."
}
"-l" = {
set_if = "$mysql_ssl$"
description = "Use ssl encryption"
}
}
vars.mysql_check_slave = true
vars.mysql_ssl = false
vars.mysql_host = "$address$"
}
apply Service "mysql-replication-health" {
import "generic-service"
check_command = "my-mysql"
vars.mysql_user = "repl"
vars. = "my_password"
// vars.mysql_database = "icinga"
// vars.mysql_host = "192.168.33.11"
vars.mysql_host = "localhost"
vars.mysql_check_slave = true
vars.sla = "24x7"
// assign where match("icinga2*", host.name)
assign where true
// ignore where host.vars.no_health_check == true
}
---------------------------------
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users