Monit 在 centos 上停止运行

Monit 在 centos 上停止运行

如何确保 monit 始终在运行?

目前它正悄悄倒下并且服务器无人监控。

服务器在 CentOS 上运行。

答案1

最好的办法是尝试找出导致它意外停止的原因,然后修复它。

作为临时/补充补救措施,您可以运行 cron 作业来监视 monit 进程,并在其不运行时启动它。

答案2

保持 monit 运行的最佳方法是使用 monit :) 也许......

由于您使用的是 CentOS,您是否正在运行 RPMForge 的 Monit 打包版本(而不是自己编译)?如果是这样,您可以通过取消注释配置文件set logfile以下节中的指令,轻松地将日志记录添加到 Monit 实例中monit.conf...

## Set syslog logging with the 'daemon' facility. If the FACILITY option is
## omitted, Monit will use 'user' facility by default. If you want to log to
## a standalone log file instead, specify the full path to the log file
#
set logfile syslog facility log_daemon
#

这样做将启用 syslog 并将输出到/var/log/messages。从这里,您可以检查守护进程失败的原因。也可以考虑在此处发布您的配置。

相关内容