我在同一台服务器上有两个 WordPress 站点。两者都使用 LetsEncrypt。一个人不断失败,另一个人成功。我不知道为什么!
check host example-a.com with address www.example-a.com
if failed icmp type echo count 5 with timeout 150 seconds then alert
if failed port 443 protocol https with timeout 150 seconds then alert
if failed (url https://example-a.com/ and content == '' and timeout 40 seconds) then alert
check host example-b.com with address www.example-b.com
if failed icmp type echo count 5 with timeout 150 seconds then alert
if failed port 443 protocol https with timeout 150 seconds then alert
if failed (url https://example-b.com/ and content == '' and timeout 40 seconds) then alert
检查
monit status
:
Remote Host 'example-a.com'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
ping response time 0.020 ms
port response time 193.949 ms to example-a.com:443/ type TCP/IP using TLS (certificate valid for 67 days) protocol HTTP
port response time 5.823 ms to www.example-a.com:443 type TCP/IP using TLS (certificate valid for 67 days) protocol HTTP
data collected Fri, 13 Oct 2023 14:39:44
Remote Host 'example-b.com'
status Connection failed
monitoring status Monitored
monitoring mode active
on reboot start
ping response time 0.016 ms
port response time FAILED to [example-b.com]:443/ type TCP/IP using TLS protocol HTTP
port response time 935.562 ms to www.example-b.com:443 type TCP/IP using TLS (certificate valid for 57 days) protocol HTTP
data collected Fri, 13 Oct 2023 14:39:46
因为一项检查有效,所以我认为这不是监控问题。但除此之外还会是什么呢?
基于Monit 5.31.0和5.33.0,我看不出有什么问题,它运行良好。
Remote Host 'example-a.com'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
ping response time -
port response time 2.784 ms to example-a.com:8081/ type TCP/IP protocol HTTP
port response time 0.342 ms to example-a.com:8081 type TCP/IP protocol HTTP
data collected Mon, 23 Oct 2023 14:00:06
Remote Host 'example-b.com'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
ping response time -
port response time 0.751 ms to example-b.com:8989/ type TCP/IP protocol HTTP
port response time 0.651 ms to example-b.com:8989 type TCP/IP protocol HTTP
data collected Mon, 23 Oct 2023 14:00:06
但是你的配置看起来很奇怪,我在手册中找不到类似的东西。
if failed (url https://example-a.com/ and content == '' and timeout 40 seconds) then alert
我认为“content == ''”应该始终匹配。