|
|
|
@ -3,7 +3,7 @@ const dayjs = require("dayjs");
|
|
|
|
|
const axios = require("axios");
|
|
|
|
|
const { Prometheus } = require("../prometheus");
|
|
|
|
|
const { log, UP, DOWN, PENDING, MAINTENANCE, flipStatus, TimeLogger } = require("../../src/util");
|
|
|
|
|
const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mqttAsync, setSetting, httpNtlm, radius, grpcQuery } = require("../util-server");
|
|
|
|
|
const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, mssqlQuery, postgresQuery, mongodbPing, mqttAsync, setSetting, httpNtlm, radius, grpcQuery } = require("../util-server");
|
|
|
|
|
const { R } = require("redbean-node");
|
|
|
|
|
const { BeanModel } = require("redbean-node/dist/bean-model");
|
|
|
|
|
const { Notification } = require("../notification");
|
|
|
|
@ -578,6 +578,14 @@ class Monitor extends BeanModel {
|
|
|
|
|
|
|
|
|
|
await postgresQuery(this.databaseConnectionString, this.databaseQuery);
|
|
|
|
|
|
|
|
|
|
bean.msg = "";
|
|
|
|
|
bean.status = UP;
|
|
|
|
|
bean.ping = dayjs().valueOf() - startTime;
|
|
|
|
|
} else if (this.type === "mongodb") {
|
|
|
|
|
let startTime = dayjs().valueOf();
|
|
|
|
|
|
|
|
|
|
await mongodbPing(this.databaseConnectionString);
|
|
|
|
|
|
|
|
|
|
bean.msg = "";
|
|
|
|
|
bean.status = UP;
|
|
|
|
|
bean.ping = dayjs().valueOf() - startTime;
|
|
|
|
|