|
|
@ -74,6 +74,7 @@ class Monitor extends BeanModel {
|
|
|
|
interval: this.interval,
|
|
|
|
interval: this.interval,
|
|
|
|
retryInterval: this.retryInterval,
|
|
|
|
retryInterval: this.retryInterval,
|
|
|
|
keyword: this.keyword,
|
|
|
|
keyword: this.keyword,
|
|
|
|
|
|
|
|
expiryNotification: this.isEnabledExpiryNotification(),
|
|
|
|
ignoreTls: this.getIgnoreTls(),
|
|
|
|
ignoreTls: this.getIgnoreTls(),
|
|
|
|
upsideDown: this.isUpsideDown(),
|
|
|
|
upsideDown: this.isUpsideDown(),
|
|
|
|
maxredirects: this.maxredirects,
|
|
|
|
maxredirects: this.maxredirects,
|
|
|
@ -101,6 +102,10 @@ class Monitor extends BeanModel {
|
|
|
|
return Buffer.from(user + ":" + pass).toString("base64");
|
|
|
|
return Buffer.from(user + ":" + pass).toString("base64");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isEnabledExpiryNotification() {
|
|
|
|
|
|
|
|
return Boolean(this.expiryNotification);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Parse to boolean
|
|
|
|
* Parse to boolean
|
|
|
|
* @returns {boolean}
|
|
|
|
* @returns {boolean}
|
|
|
@ -240,7 +245,7 @@ class Monitor extends BeanModel {
|
|
|
|
let tlsInfoObject = checkCertificate(res);
|
|
|
|
let tlsInfoObject = checkCertificate(res);
|
|
|
|
tlsInfo = await this.updateTlsInfo(tlsInfoObject);
|
|
|
|
tlsInfo = await this.updateTlsInfo(tlsInfoObject);
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.getIgnoreTls()) {
|
|
|
|
if (!this.getIgnoreTls() && this.isEnabledExpiryNotification()) {
|
|
|
|
debug(`[${this.name}] call sendCertNotification`);
|
|
|
|
debug(`[${this.name}] call sendCertNotification`);
|
|
|
|
await this.sendCertNotification(tlsInfoObject);
|
|
|
|
await this.sendCertNotification(tlsInfoObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|