gpt4 book ai didi

ssl - monit:监控证书

转载 作者:太空宇宙 更新时间:2023-11-03 14:27:19 24 4
gpt4 key购买 nike

我目前正在尝试监控我的系统证书,以确保在过期前 30 天收到警报。作为示例,我以 google.com 为例并监控其证书。查看 monitrc 文件,我添加了这个:

check host google.com with address google.com
if failed
port 443
protocol https
with ssl options {verify: enable}
certificate valid > 1095 days
then alert

当我重新启动 monit 时出现错误,没有名为 google.com 的服务

最佳答案

当设置新的 monit 配置或更改/编辑当前配置时,应首先重新加载以确保 monit 重新初始化守护进程

重现问题

# Edit monit config
root@home:~# vim /etc/monit/conf-enabled/test

# Restart right way will fail
root@home:~# monit restart all
There is no service named "google.com"

# Logs
[CEST Sep 12 19:16:29] info : 'home' trying to restart
[CEST Sep 12 19:16:29] info : 'home' restart action done
[CEST Sep 12 19:17:09] info : 'home' restart on user request
[CEST Sep 12 19:17:09] error : HttpRequest: error -- client [::1]: HTTP/1.0 400 There is no service named "google.com"
[CEST Sep 12 19:17:09] error : There is no service named "google.com"

解决方案

# Edit monit config
root@home:~# vim /etc/monit/conf-enabled/test

# Reload to reinitialize monit
root@home:~# monit reload
Reinitializing monit daemon

root@home:~# monit status
Monit 5.25.2 uptime: 24m

Remote Host 'google.com'
status OK
monitoring status Monitored
monitoring mode active
on reboot start
port response time 878.069 ms to google.com:443 type TCP/IP using TLS (certificate valid for 69 days) protocol HTTP
data collected Thu, 12 Sep 2019 19:24:06

关于ssl - monit:监控证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55945079/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com