User Name
Password
AppleNova Forums » Feedback »

SSL expiring soon... again...


Register Members List Calendar Search FAQ Posting Guidelines
SSL expiring soon... again...
Thread Tools
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2022-08-11, 10:34

Code:
Check SSL (forums.applenova.com) (Zabbix server:system.run[/etc/zabbix/externalscripts/checkssl.sh forums.applenova.com]): 15
So I have a script running that feeds my zabbix monitoring to let me know when the cert is going to expire since LE seems to have stopped emailing us for these dates approaching.

Code:
# cat /etc/zabbix/externalscripts/checkssl.sh #!/bin/bash data=`echo | openssl s_client -servername $1 -connect $1:443 2>/dev/null | openssl x509 -noout -enddate | sed -e 's#notAfter=##'` ssldate=`date -d "${data}" '+%s'` nowdate=`date '+%s'` diff="$((${ssldate}-${nowdate}))" echo $((${diff}/86400))
If you want to make this something that just emails you from your server you can instead use this one:
Code:
$ cat testemail.sh #################### #!/bin/bash # # Check certs and email when renewal needed # data=`echo | openssl s_client -servername $1 -connect $1:443 2>/dev/null | openssl x509 -noout -enddate | sed -e 's#notAfter=##'` ssldate=`date -j -f "%b %d %T %Y %Z" "${data}" '+%s'` nowdate=`date '+%s'` diff="$((${ssldate}-${nowdate}))" daysleft=$((${diff}/86400)) #echo $daysleft echo "$1 SSL Certificate expires in $daysleft! Take action to renew it now!" | mail -s "URGENT: $1 SSL Certificate expiring soon" brad@bradsdomain.com

Louis L'Amour, “To make democracy work, we must be a notion of participants, not simply observers. One who does not vote has no right to complain.”
MineCraft? mc.applenova.com | Visit us! | Maybe someday I'll proof read, until then deal with it.
  quote
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2022-08-11, 10:40

Of course, if I weren't running this through the monitoring server I would have to if/then to not email under 15 days.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Powerbook 12" optical drive dead, won't accept discs! urgent applecare expiring soon! stevegong Genius Bar 6 2006-08-15 20:22


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 16:01.


Powered by vBulletin®
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2022, AppleNova