check Mysql with remote host - Icinga2

by ratsimba soa   Last Updated March 14, 2019 20:00 PM

I'm using Icinga2 to monitor Mysql server on a remote host.Now, I'm trying to configure a mysql_check.

Here is the file service.conf :

apply Service "mysql8" {  
  import "generic-service"
 check_command = "mysql"

 vars.mysql_mode = "uptime"
 vars.mysql_hostname = "remote-host"
 vars.mysql_port = "3306"
 vars.mysql_username = "username"
 vars.myql_password = "password"
 command_endpoint = host.vars.client_endpoint
 assign where host.vars.mysql == true && host.vars.client_endpoint
}

Here is the file host.conf :

object Host "remote-host" {
import "generic-host"
address = "xxx.xxx.xx.xxx"
vars.os = "linux"
vars.mysql = true
host.vars.client_endpoint="remote-host"

When I try a check_MySQLfrom Icinga2, I got the following error :

Can't connect to MySQL server on 'remote-host' (111)

What should I do to resolve the check_MySQL with the remote-host.

Thanks.



Related Questions


Updated September 09, 2017 00:00 AM

Updated March 12, 2019 21:00 PM

Updated October 25, 2017 14:00 PM

Updated August 08, 2017 10:00 AM