CentOS下monit配置

CentOS下monit配置

我正在尝试执行以下操作:

monit stop mysqld
monit: Cannot connect to the monit daemon. Did you start it with http support?

它仅当我停止服务时才起作用monit

你有什么建议吗?

答案1

确保已启用嵌入式 Web 服务器。此monit stop ...命令在内部使用它。

# Monit has an embedded web server which can be used to view status of 
# services monitored and manage services from a web interface. See the
# Monit Wiki if you want to enable SSL for the web server. 

set httpd port 2812 and
    use address localhost  # only accept connection from localhost
    allow localhost        # allow localhost to connect to the server and
    allow admin:monit      # require user 'admin' with password 'monit'

如果省略此“使用地址 localhost”行,请更改密码。

答案2

请发布您的 monit 配置。该monit stop进程引用配置节中定义的进程名称。因此,如果您有 MySQL 的配置条目,它应该看起来像check process mysql with pidfile...

您的monit stop命令应该使用与配置文件中“process”后面的单词相同的名称。

相关内容