diff --git a/config.php b/config.php new file mode 100644 index 0000000..eb958ff --- /dev/null +++ b/config.php @@ -0,0 +1,7 @@ + diff --git a/functions.php b/functions.php index 4145986..edd447e 100644 --- a/functions.php +++ b/functions.php @@ -6,7 +6,7 @@ function getNginxStatus() { return ($status === 'active') ? 'running' : 'not running'; } function getNginxConnections() { - $connections = shell_exec("netstat -an | grep ':80' | wc -l"); + $connections = shell_exec("netstat -an | grep ':$nginxPort' | wc -l"); return intval(trim($connections)); } diff --git a/index.php b/index.php index e5676e6..bfd7f5b 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,6 @@ getJicofoStatus(), @@ -35,7 +36,7 @@ if ($request === '/nginx' || $request === "/$scriptname/nginx") { // jvb status } elseif ($request === '/jvb' || $request === "/$scriptname/jvb") { - $jvbStatsCommand = 'curl -s http://localhost:8080/stats'; + $jvbStatsCommand = "curl -s $jvbStatsURL"; $jvbStatsData = getJVBStats($jvbStatsCommand); $data = [ 'jvb_status' => getJVBStatus(),