https证书即将过期则告警
配置文件
telegtaf
; 添加到 /etc/telegraf/telegraf.conf
[[inputs.exec]]
commands = ["/etc/telegraf/https-certificate-validity"]
timeout = "5s"
name_suffix = "_https_certificate_validity"
data_format = "json"
data_type = "integer"
sudo systemctl stop telegraf && sudo systemctl start telegraf
[centos@hostname telegraf]$ ./https-certificate-validity
{
"data": {
"name_1": 329,
"name_2": 329
},
"errs_count": 0,
"errs": []
}
[centos@hostname ~]$ telegraf -input-filter exec -test
> exec_https_certificate_validity,host=hostname domains_name_1=329,domains_name_2=329,errs_count=0 0000000000000000000
下载程序