[#2593] renamed the method `sendCertNotification` to better represent what id does. Evaluate certificate expiry from all certs in chain. Send a separate notification for every cert in chain, including cert type and CN.
log.debug("monitor",`No need to send cert notification for ${certInfo.certType} certificate "${subjectCN}" (${certInfo.daysRemaining} days valid) on ${targetDays} deadline.`);
}else{
log.debug("monitor",`call sendCertNotificationByTargetDays for ${targetDays} deadline on certificate ${subjectCN}.`);
letrow=awaitR.getRow("SELECT * FROM notification_sent_history WHERE type = ? AND monitor_id = ? AND days = ?",[
"certificate",
@ -1175,7 +1185,7 @@ class Monitor extends BeanModel {
for(letnotificationofnotificationList){
try{
log.debug("monitor","Sending to "+notification.name);
awaitNotification.send(JSON.parse(notification.config),`[${this.name}][${this.url}] Certificate will be expired in ${daysRemaining} days`);
awaitNotification.send(JSON.parse(notification.config),`[${this.name}][${this.url}] ${certType} certificate ${certCN} will be expired in ${daysRemaining} days`);
sent=true;
}catch(e){
log.error("monitor","Cannot send cert notification to "+notification.name);
@ -1190,9 +1200,6 @@ class Monitor extends BeanModel {
targetDays,
]);
}
}else{
log.debug("monitor","No notification, no need to send cert notification");