From e99cd18268b0dee10e4b572ae460fac25b7d0941 Mon Sep 17 00:00:00 2001 From: iotux <46082385+iotux@users.noreply.github.com> Date: Fri, 2 Jan 2026 07:07:47 +0100 Subject: [PATCH] Update server/monitor-types/system-service.js Thanks for your help wit this Co-authored-by: Frank Elsinga --- server/monitor-types/system-service.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/monitor-types/system-service.js b/server/monitor-types/system-service.js index 1e526b684..62d2a019f 100644 --- a/server/monitor-types/system-service.js +++ b/server/monitor-types/system-service.js @@ -15,16 +15,14 @@ class SystemServiceMonitorType extends MonitorType { * @returns {Promise} Resolves when check is complete. */ async check(monitor, heartbeat) { - const serviceName = monitor.system_service_name; - - if (!serviceName) { + if (!monitor.system_service_name) { throw new Error("Service Name is required."); } if (process.platform === "win32") { - return this.checkWindows(serviceName, heartbeat); + return this.checkWindows(monitor.system_service_name, heartbeat); } else if (process.platform === "linux") { - return this.checkLinux(serviceName, heartbeat); + return this.checkLinux(monitor.system_service_name, heartbeat); } else { throw new Error(`System Service monitoring is not supported on ${process.platform}`); }