结合邮件告警和页面展示,再多的域名证书到期情况即可立马知道
代码示例:
# coding: utf-8
# 查询域名证书到期情况
import re
import time
import subprocess
from datetime import datetime
from io import StringIO
def main(domain):
f = StringIO()
comm = fcurl -Ivs https://{domain} --connect-timeout 10
result = subprocess.getstatusoutput(comm)
1