我正在使用Icinga2来监视远程host.Now上的Mysql服务器,我正在尝试配置一个mysql_check。
以下是文件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
}以下是文件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"当我尝试使用来自check_MySQL的Icinga2时,我得到了以下错误:
无法连接到“远程主机”上的MySQL服务器(111)
我能做些什么来解决check_MySQL与远程主机。
谢谢。
发布于 2019-03-15 21:29:18
很高兴在这里见到你。
我认为mysql服务器不允许远程访问。
在这种情况下:
user@example.com。-N :转发端口
-L :将本地端口绑定到远程主机端口2。
$ mysql --protocol TCP -h localhost -u YOUR_MYSQL_USER -P 3307 -p是工作吗?因此:)
vars.mysql_port=3307即可。太棒了!很棒的东西!没有吗?
https://stackoverflow.com/questions/55175214
复制相似问题