|
|
|
@ -50,6 +50,7 @@ class Monitor extends BeanModel {
|
|
|
|
|
accepted_statuscodes: this.getAcceptedStatuscodes(),
|
|
|
|
|
dns_resolve_type: this.dns_resolve_type,
|
|
|
|
|
dns_resolve_server: this.dns_resolve_server,
|
|
|
|
|
dns_last_result: this.dns_last_result,
|
|
|
|
|
notificationIDList,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
@ -207,6 +208,17 @@ class Monitor extends BeanModel {
|
|
|
|
|
dnsMessage = dnsMessage.slice(0, -2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let dnsLastResult = await R.findOne("monitor", "id = ?", [
|
|
|
|
|
this.id,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
if (dnsLastResult.dnsLastResult !== dnsMessage) {
|
|
|
|
|
R.exec("UPDATE `monitor` SET dns_last_result = ? WHERE id = ? ", [
|
|
|
|
|
dnsMessage,
|
|
|
|
|
this.id
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bean.msg = dnsMessage;
|
|
|
|
|
bean.status = UP;
|
|
|
|
|
}
|
|
|
|
|