From e7cd378a8177b0b12739954a25344b82460894a1 Mon Sep 17 00:00:00 2001 From: joseph le Date: Thu, 12 Oct 2023 08:45:58 +0700 Subject: [PATCH] Update function check status for other system --- app/utils/sendStatusOtherSystem.js | 39 +++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/app/utils/sendStatusOtherSystem.js b/app/utils/sendStatusOtherSystem.js index 5b93747..3ed0cff 100644 --- a/app/utils/sendStatusOtherSystem.js +++ b/app/utils/sendStatusOtherSystem.js @@ -762,6 +762,31 @@ const checkMultipleRequest = async () => { name: "Auto import Disti", group: "Other Systems", }, + //Test Log System + { + url: "nc -zv 172.16.7.13 8002", + method: "EXEC", + headers: {}, + data: {}, + name: "ATC to ERP", + group: "Test Log System", + }, + { + url: "nc -zv 172.16.7.13 5000", + method: "EXEC", + headers: {}, + data: {}, + name: "ATC worked", + group: "Test Log System", + }, + { + url: "nc -zv 172.16.6.23 7777", + method: "EXEC", + headers: {}, + data: {}, + name: "Read Test Log", + group: "Test Log System", + }, ]; const logicCheck = async (req, response) => { @@ -995,11 +1020,12 @@ const checkMultipleRequest = async () => { }); } - if (req.method === "SSH") { + if (req.method === "EXEC") { const stdout = await runExec(req.url); if (stdout !== "") { let responseDataString = JSON.stringify(stdout, null, 2); allResponse += `${req.name}\n${responseDataString}\n\n`; + if (req.name === "Perthmint") { if (stdout.toString().split("true").length - 1 > 1) { report.push({ @@ -1019,6 +1045,17 @@ const checkMultipleRequest = async () => { }); } } + + if(req.group === "Test Log System"){ + report.push({ + group: req.group, + name: req.name, + status: ":check:", + code: "good", + lengthOrData: stdout, + }); + } + } else { console.log(stdout); let responseDataString = JSON.stringify(stdout, null, 2);