I want to create more “inteligent” way of renewing ssl certificate than
- run addon restart letsencrypt
- folowed by homeassistant restart.
- hope for the best.
Moust of the things i figured out already but i have one key thing missing. When you restart letsencrypt it output some informations like this for example:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Certificate not yet due for renewal
Certificate not yet due for renewal; no action taken.
My question is this. How can i catch that output in node-red. i tried to put in “output properties” “msg.log = results” but my msg.log comse moustly empty or with basic info about execution like date etc.
So i ask someone smarter than me for any help / clue.
For those who want to know why i need this. I want to create automation in nodered like this.
-----repeat everyday ------
- i want to check expiry date of certificate.
- if date is bigger than 20 days from now do nothing
- if date is between 20-10 days try to restart letsencrypt
a) if success (based on logs letsencrypt provide)
- restart homeasistant
- read new ssl expiry date and confirm that is >20 days. if not report error
b) if error (based on letsencrypt logs) wait for next execution window (1day for me ) - if date is <10 days (we know there is a problem becouse we have 10 retries failed already) start reporting error in ssl certificate renewal + add in message information from letsencrypt logs. (for me it is sms on my phone)
