mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-23 15:01:00 -04:00
feat: support redis monitor
This commit is contained in:
parent
bc7271b99c
commit
40ebc2df79
7 changed files with 195 additions and 2 deletions
|
@ -19,6 +19,7 @@ const { Settings } = require("./settings");
|
|||
const grpc = require("@grpc/grpc-js");
|
||||
const protojs = require("protobufjs");
|
||||
const radiusClient = require("node-radius-client");
|
||||
const redis = require("redis");
|
||||
const {
|
||||
dictionaries: {
|
||||
rfc2865: { file, attributes },
|
||||
|
@ -353,6 +354,19 @@ exports.radius = function (
|
|||
],
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Redis server ping
|
||||
* @param {string} dsn The redis connection string
|
||||
*/
|
||||
exports.redisPingAsync = async function (dsn) {
|
||||
const client = redis.createClient({
|
||||
url: dsn,
|
||||
});
|
||||
await client.connect();
|
||||
const pong = await client.ping();
|
||||
await client.disconnect();
|
||||
return pong;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve value of setting based on key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue