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:
iotux
2025-12-14 16:39:00 +01:00
parent 883083f5c3
commit 7461bd296f
8 changed files with 225 additions and 39 deletions
+11
View File
@@ -900,6 +900,9 @@ let needSetup = false;
bean.rabbitmqPassword = monitor.rabbitmqPassword;
bean.conditions = JSON.stringify(monitor.conditions);
bean.manual_status = monitor.manual_status;
bean.local_service_command = monitor.local_service_command;
bean.local_service_expected_output = monitor.local_service_expected_output;
bean.local_service_check_type = monitor.local_service_check_type;
// ping advanced options
bean.ping_numeric = monitor.ping_numeric;
@@ -1173,6 +1176,8 @@ let needSetup = false;
bean.color = tag.color;
await R.store(bean);
await Prometheus.init();
callback({
ok: true,
tag: await bean.toJSON(),
@@ -1248,6 +1253,8 @@ let needSetup = false;
value,
]);
await server.sendUpdateMonitorIntoList(socket, monitorID);
callback({
ok: true,
msg: "successAdded",
@@ -1272,6 +1279,8 @@ let needSetup = false;
monitorID,
]);
await server.sendUpdateMonitorIntoList(socket, monitorID);
callback({
ok: true,
msg: "successEdited",
@@ -1296,6 +1305,8 @@ let needSetup = false;
value,
]);
await server.sendUpdateMonitorIntoList(socket, monitorID);
callback({
ok: true,
msg: "successDeleted",