From 8c97bd287378c04cd1afa4edb2fcaa629a0bb8c6 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Sun, 1 Sep 2024 16:29:59 +0300 Subject: [PATCH] Adds simple status checks for nginx and JVB --- functions.php | 31 +++++++++++++++++++++++++++++++ index.php | 28 ++++++++++++++++++++++++++++ jilo-agent.php | 16 ---------------- 3 files changed, 59 insertions(+), 16 deletions(-) create mode 100644 functions.php create mode 100644 index.php delete mode 100644 jilo-agent.php diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..1d12a48 --- /dev/null +++ b/functions.php @@ -0,0 +1,31 @@ + diff --git a/index.php b/index.php new file mode 100644 index 0000000..f10e6c9 --- /dev/null +++ b/index.php @@ -0,0 +1,28 @@ + getNginxStatus(), + 'nginx_connections' => getNginxConnections(), + ]; + echo json_encode($data, JSON_PRETTY_PRINT) . "\n"; + +// jvb status +} elseif ($_SERVER['REQUEST_URI'] === '/jvb') { + $data = [ + 'jvb_status' => getJVBStatus(), + ]; + echo json_encode($data, JSON_PRETTY_PRINT) . "\n"; + +// default response - error +} else { + echo json_encode(['error' => 'Endpoint not found']) . "\n"; +} + +?> diff --git a/jilo-agent.php b/jilo-agent.php deleted file mode 100644 index 49bae8a..0000000 --- a/jilo-agent.php +++ /dev/null @@ -1,16 +0,0 @@ - shell_exec('/etc/init.d/nginx status')]); - -// jvb status -} elseif ($_SERVER['REQUEST_URI'] === '/jvb/status') { - echo json_encode(['jvb' => shell_exec('/etc/init.d/jitsi-videobridge status')]); - -// default response - error -} else { - echo json_encode(['error' => 'Endpoint not found']); -} - -?>