0
0

More than 5 years have passed since last update.

証明書の残りの有効な日数をとる

Posted at

おしえてもらったのでメモっときます。

export UTIME=$(date +%s);
echo \(""`date --date "\`openssl s_client -connect hoge.com:443 < /dev/null 2>/dev/null| openssl x509 -text|grep "Not After"|awk '{print $4" "$5" "$6" "$8" "$7}'\`" +%s`" - ${UTIME}) / 86400"|bc

ELBに入ってるやつとnginxで終端してるやつでとり方が違うかんじになりそうかな。
監視はzabbixなのでlocalからagent.confに書いてとるかsenderでなげるかまあ、この感じだとつながりさえすればどっからでも取れそうなので色々やりようがありそう。

参考
http://qiita.com/ma3ki/items/302205c0402c3746c9ff

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0