Forum Discussion
David_Dalgaard_
Jul 25, 2013Nimbostratus
Script to check for certificate expiration
Hi guys
Most of you have probably been in the situation where a certificate suddenly expired without anyone noticing (or at least no one took proper action). I was in that situation a couple of ...
psxg_345884
Jan 11, 2018Nimbostratus
I have:
CERTEXPIRE=$(echo $line | awk -F 'expired on ''{print $2}')
CERTEXPIREEPOCH=$(date --date="$CERTEXPIRE" +%s)
CERTEXPIREDIFF=$(expr $CERTEXPIREEPOCH - $CURRENTTIMEEPOCH)
if (($CERTEXPIREDIFF < 2419200)); then
BODY="\n\nIf it was not previously done, please create a Service Now Ticket for Systems team in order to renew the certificate.\n\nIgnore this
alarm if the certificate is /Common/ca-bundle.crt\n\nThis is an auto-generated e-mail from the BIG-IP."
echo -e "$CERT expires on $CERTEXPIRE GMT.$BODY" | mail -s "WARNING: $CERT EXPIRES IN LESS THAN A MONTH!!" $MAIL -c $MAILCC
echo "--> WARNING: $CERT EXPIRES IN LESS THAN A MONTH!!"
NUMCRITICAL=$[$NUMCRITICAL +1]
fi
I see it declared just fine. Is "$CERTEXPIRE GMT.$BODY"" correct ?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects