mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-05-17 08:26:56 +03:00
feat: Add 'local service' monitor type
This adds a new monitor type to check local services by executing a shell command. It also includes fixes for Prometheus errors when adding new tags and for the UI not updating when tags are changed.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
const { settings } = require("../../server/util-server");
|
||||
|
||||
/**
|
||||
* @param {import("knex").Knex} knex
|
||||
*/
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable("monitor", (table) => {
|
||||
table.string("local_service_command");
|
||||
table.string("local_service_expected_output");
|
||||
table.string("local_service_check_type").notNullable().defaultTo("keyword");
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {import("knex").Knex} knex
|
||||
*/
|
||||
exports.down = async (knex) => {
|
||||
if (await knex.schema.hasColumn("monitor", "local_service_command")) {
|
||||
await knex.schema.alterTable("monitor", (table) => {
|
||||
table.dropColumn("local_service_command");
|
||||
});
|
||||
}
|
||||
if (await knex.schema.hasColumn("monitor", "local_service_expected_output")) {
|
||||
await knex.schema.alterTable("monitor", (table) => {
|
||||
table.dropColumn("local_service_expected_output");
|
||||
});
|
||||
}
|
||||
if (await knex.schema.hasColumn("monitor", "local_service_check_type")) {
|
||||
await knex.schema.alterTable("monitor", (table) => {
|
||||
table.dropColumn("local_service_check_type");
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user