From 8455c986674caab4ba844414ce6fed4baa0dd738 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 28 Jun 2025 22:03:36 -0600 Subject: [PATCH] Renamed to system_status --- .../dashboard/system_cpu_status_1.php | 173 ------------------ .../service/debian-system_dashboard.service | 8 +- .../service/{system.php => system_status.php} | 0 3 files changed, 4 insertions(+), 177 deletions(-) delete mode 100644 app/system/resources/dashboard/system_cpu_status_1.php rename app/system/resources/service/{system.php => system_status.php} (100%) diff --git a/app/system/resources/dashboard/system_cpu_status_1.php b/app/system/resources/dashboard/system_cpu_status_1.php deleted file mode 100644 index b4fdb7eba4..0000000000 --- a/app/system/resources/dashboard/system_cpu_status_1.php +++ /dev/null @@ -1,173 +0,0 @@ -get($_SESSION['domain']['language']['code'], 'app/system'); - -//system cpu status - echo "
\n"; - -//set the row style class names - $c = 0; - $row_style["0"] = "row_style0"; - $row_style["1"] = "row_style1"; - -//get the CPU details - if (stristr(PHP_OS, 'BSD') || stristr(PHP_OS, 'Linux')) { - - $result = shell_exec('ps -A -o pcpu'); - $percent_cpu = 0; - foreach (explode("\n", $result) as $value) { - if (is_numeric($value)) { $percent_cpu = $percent_cpu + $value; } - } - if (stristr(PHP_OS, 'BSD')) { - $result = shell_exec("dmesg | grep -i --max-count 1 CPUs | sed 's/[^0-9]*//g'"); - $cpu_cores = trim($result); - } - if (stristr(PHP_OS, 'Linux')) { - $result = @trim(shell_exec("grep -P '^processor' /proc/cpuinfo")); - $cpu_cores = count(explode("\n", $result)); - } - if ($cpu_cores > 1) { $percent_cpu = $percent_cpu / $cpu_cores; } - $percent_cpu = round($percent_cpu, 2); - - //uptime - $result = shell_exec('uptime'); - $load_average = sys_getloadavg(); - - } - -//show the content - echo "
\n"; - echo " ".$text['label-cpu_usage']."\n"; - -//add half doughnut chart - if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { - ?> -
- - - ".round($percent_cpu)."%"; - } - echo "
\n"; - - if ($dashboard_details_state != 'disabled') { - echo "
"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if (PHP_OS == 'FreeBSD' || PHP_OS == 'Linux') { - if (!empty($percent_cpu)) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $c = ($c) ? 0 : 1; - } - - if (!empty($cpu_cores)) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $c = ($c) ? 0 : 1; - } - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $c = ($c) ? 0 : 1; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $c = ($c) ? 0 : 1; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $c = ($c) ? 0 : 1; - } - - echo "
".$text['label-name']."".$text['label-value']."
\n"; - echo "
"; - //$n++; - - echo ""; - } - echo "
\n"; - -?> diff --git a/app/system/resources/service/debian-system_dashboard.service b/app/system/resources/service/debian-system_dashboard.service index c00092af30..d36ad17744 100644 --- a/app/system/resources/service/debian-system_dashboard.service +++ b/app/system/resources/service/debian-system_dashboard.service @@ -1,7 +1,7 @@ ; Author: Mark J Crane -; cp /var/www/fusionpbx/app/system/resources/service/debian.service /etc/systemd/system/system_dashboard.service +; cp /var/www/fusionpbx/app/system/resources/service/debian.service /etc/systemd/system/system_status.service ; systemctl daemon-reload -; systemctl enable --now system_dashboard +; systemctl enable --now system_status [Unit] Description=FusionPBX System Dashboard Information Service @@ -15,14 +15,14 @@ StartLimitIntervalSec=0 [Service] Type=simple ;Type=forking -PIDFile=/var/run/fusionpbx/system_dashboard.pid +PIDFile=/var/run/fusionpbx/system_status.pid WorkingDirectory=/var/www/fusionpbx ;Environment="USER=www-data" ;Environment="GROUP=www-data" ;EnvironmentFile=-/etc/default/fusionpbx ExecStartPre=/bin/mkdir -p /var/run/fusionpbx ;ExecStartPre=/bin/chown -R ${USER}:${GROUP} /var/www/fusionpbx -ExecStart=/usr/bin/php /var/www/fusionpbx/app/system/resources/service/system.php --no-fork +ExecStart=/usr/bin/php /var/www/fusionpbx/app/system/resources/service/system_status.php --no-fork User=www-data Group=www-data TimeoutSec=55s diff --git a/app/system/resources/service/system.php b/app/system/resources/service/system_status.php similarity index 100% rename from app/system/resources/service/system.php rename to app/system/resources/service/system_status.php