mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Merge branch 'main' of https://github.com/jokob-sk/Pi.Alert
This commit is contained in:
@@ -8,7 +8,7 @@ ENV USER=pi USER_ID=1000 USER_GID=1000 PORT=20211
|
|||||||
# Todo, do we still need all these packages? I can already see sudo which isn't needed
|
# Todo, do we still need all these packages? I can already see sudo which isn't needed
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install --no-install-recommends tini snmp ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools python3 iproute2 nmap python3-pip zip systemctl usbutils -y \
|
&& apt-get install --no-install-recommends tini snmp ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools python3 iproute2 nmap python3-pip zip systemctl usbutils traceroute -y \
|
||||||
&& pip3 install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi \
|
&& pip3 install requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi \
|
||||||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
|
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
|
||||||
&& apt-get clean autoclean \
|
&& apt-get clean autoclean \
|
||||||
|
|||||||
@@ -648,6 +648,35 @@
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ($_REQUEST['mac'] != 'Internet') {
|
||||||
|
?>
|
||||||
|
<h4 class=""><i class="fa-solid fa-route"></i> <?= lang('DevDetail_Tab_Tools_Traceroute_Title');?></h4>
|
||||||
|
<h5 class=""><?= lang('DevDetail_Tab_Tools_Traceroute_Description');?></h5>
|
||||||
|
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||||
|
<button type="button" id="traceroute" class="btn btn-primary pa-btn" style="margin: auto;" onclick="traceroute()"><?= lang('DevDetail_Tab_Tools_Traceroute_Start');?></button>
|
||||||
|
<br><div id="tracerouteoutput" style="margin-top: 10px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function traceroute() {
|
||||||
|
|
||||||
|
$( "#tracerouteoutput" ).empty();
|
||||||
|
$.ajax({
|
||||||
|
method: "GET",
|
||||||
|
url: "./php/server/traceroute.php?action=get&ip=" + document.getElementById('txtLastIP').value + "",
|
||||||
|
beforeSend: function() { $('#tracerouteoutput').addClass("ajax_scripts_loading"); },
|
||||||
|
complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); },
|
||||||
|
success: function(data, textStatus) {
|
||||||
|
$("#tracerouteoutput").html(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
40
front/php/server/traceroute.php
Normal file
40
front/php/server/traceroute.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
###################################################################################
|
||||||
|
# Pi.Alert #
|
||||||
|
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
||||||
|
# #
|
||||||
|
# traceroute.php # Front module. Server side. System Information #
|
||||||
|
###################################################################################
|
||||||
|
# Puche 2021 pi.alert.application@gmail.com GNU GPLv3 #
|
||||||
|
# jokob-sk 2022 jokob.sk@gmail.com GNU GPLv3 #
|
||||||
|
# leiweibau 2022 https://github.com/leiweibau GNU GPLv3 #
|
||||||
|
# cvc90 2023 https://github.com/cvc90 GNU GPLv3 #
|
||||||
|
###################################################################################
|
||||||
|
|
||||||
|
// Get init.php
|
||||||
|
require dirname(__FILE__).'/../server/init.php';
|
||||||
|
|
||||||
|
// Get IP
|
||||||
|
$ip = $_GET['ip'];
|
||||||
|
|
||||||
|
// Check if IP is valid
|
||||||
|
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
|
||||||
|
// Error message
|
||||||
|
$output = lang('DevDetail_Tab_Tools_Traceroute_Error');
|
||||||
|
// Show the result
|
||||||
|
echo "<pre>";
|
||||||
|
echo $output;
|
||||||
|
echo "</pre>";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test with the "Traceroute" command
|
||||||
|
$output = shell_exec("traceroute $ip");
|
||||||
|
|
||||||
|
// Show the result
|
||||||
|
echo "<pre>";
|
||||||
|
echo $output;
|
||||||
|
echo "</pre>";
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -125,6 +125,10 @@
|
|||||||
"DevDetail_Tab_Tools_Speedtest_Title": "Speedtest test",
|
"DevDetail_Tab_Tools_Speedtest_Title": "Speedtest test",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Description": "Das Speedtest-Tool misst die Download-Geschwindigkeit, Upload-Geschwindigkeit und Latenz der Internetverbindung.",
|
"DevDetail_Tab_Tools_Speedtest_Description": "Das Speedtest-Tool misst die Download-Geschwindigkeit, Upload-Geschwindigkeit und Latenz der Internetverbindung.",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Start": "Speedtest starten",
|
"DevDetail_Tab_Tools_Speedtest_Start": "Speedtest starten",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Description": "Traceroute ist ein Netzwerkdiagnosebefehl, mit dem der Pfad verfolgt wird, den Datenpakete von einem Host zu einem anderen nehmen.<br><br>Der Befehl verwendet das Internet Control Message Protocol (ICMP), um Pakete an Zwischenknoten auf der Route zu senden, jeden Zwischenknoten Der Knoten antwortet mit einem ICMP-Timeout-Paket (TTL-Zeitüberschreitung).<br><br>Die Ausgabe des Traceroute-Befehls zeigt die IP-Adresse jedes Zwischenknotens auf der Route an.<br><br>Die Ausgabe der Traceroute Der Befehl zeigt die IP-Adresse jedes Zwischenknotens auf der Route an.<br><br>Der Befehl „traceroute“ kann zur Diagnose von Netzwerkproblemen wie Verzögerungen, Paketverlust und blockierten Routen verwendet werden.<br><br>Das ist auch möglich kann verwendet werden, um den Standort eines Zwischenknotens in einem Netzwerk zu identifizieren.",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Start": "Traceroute starten",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Error": "Fehler: IP-Adresse ist ungültig",
|
||||||
"DevDetail_Tab_Nmap" : "Nmap",
|
"DevDetail_Tab_Nmap" : "Nmap",
|
||||||
"DevDetail_Tab_NmapTableIndex": "Index",
|
"DevDetail_Tab_NmapTableIndex": "Index",
|
||||||
"DevDetail_Tab_NmapTableTime": "Zeit",
|
"DevDetail_Tab_NmapTableTime": "Zeit",
|
||||||
@@ -410,6 +414,7 @@
|
|||||||
"Systeminfo_System_AVG": "AVG laden:",
|
"Systeminfo_System_AVG": "AVG laden:",
|
||||||
"Systeminfo_System_Kernel": "Kernel:",
|
"Systeminfo_System_Kernel": "Kernel:",
|
||||||
"Systeminfo_System_OSVersion": "Betriebssystem:",
|
"Systeminfo_System_OSVersion": "Betriebssystem:",
|
||||||
|
"Systeminfo_System_Running_Processes" : "Laufende Prozesse:",
|
||||||
"Systeminfo_System_System": "System:",
|
"Systeminfo_System_System": "System:",
|
||||||
"Systeminfo_System_Uname": "Uname:",
|
"Systeminfo_System_Uname": "Uname:",
|
||||||
"Systeminfo_System_Uptime": "Betriebszeit:",
|
"Systeminfo_System_Uptime": "Betriebszeit:",
|
||||||
|
|||||||
@@ -147,8 +147,12 @@
|
|||||||
"DevDetail_Tab_Tools_Internet_Info_Error": "An error has occurred",
|
"DevDetail_Tab_Tools_Internet_Info_Error": "An error has occurred",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Title" : "Online Speedtest",
|
"DevDetail_Tab_Tools_Speedtest_Title" : "Online Speedtest",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Description" : "The Speedtest tool measures the download speed, upload speed and latency of the internet connection.",
|
"DevDetail_Tab_Tools_Speedtest_Description" : "The Speedtest tool measures the download speed, upload speed and latency of the internet connection.",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Start" : "Start Speedtest",
|
"DevDetail_Tab_Tools_Speedtest_Start" : "Start Speedtest",
|
||||||
"DevDetail_Tab_Nmap" : "<i class=\"fa fa-ethernet\"></i> Nmap",
|
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Description": "Traceroute is a network diagnostic command used to trace the path that data packets take from one host to another.<br><br>The command uses the Internet Control Message Protocol (ICMP) to send packets to intermediate nodes on the route, each intermediate node responds with an ICMP time-out (TTL timed out) packet.<br><br>The output of the traceroute command displays the IP address of each intermediate node on the route.<br><br>The output of the traceroute command displays the IP address of each intermediate node on the route.<br><br>The traceroute command can be used to diagnose network problems, such as delays, packet loss, and blocked routes.<br><br>It can also be used to identify the location of an intermediate node on a network.",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Start": "Start Traceroute",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Error": "Error: IP address is not valid",
|
||||||
|
"DevDetail_Tab_Nmap" : "<i class=\"fa fa-ethernet\"></i> Nmap",
|
||||||
"DevDetail_Tab_Sessions" : "<i class=\"fa fa-list-ol\"></i> Sessions",
|
"DevDetail_Tab_Sessions" : "<i class=\"fa fa-list-ol\"></i> Sessions",
|
||||||
"DevDetail_Tab_Presence" : "<i class=\"fa fa-calendar\"></i> Presence",
|
"DevDetail_Tab_Presence" : "<i class=\"fa fa-calendar\"></i> Presence",
|
||||||
"DevDetail_Tab_Events" : "<i class=\"fa fa-bolt\"></i> Events",
|
"DevDetail_Tab_Events" : "<i class=\"fa fa-bolt\"></i> Events",
|
||||||
@@ -648,6 +652,7 @@
|
|||||||
"Systeminfo_System_AVG": "Load average:",
|
"Systeminfo_System_AVG": "Load average:",
|
||||||
"Systeminfo_System_Kernel": "Kernel:",
|
"Systeminfo_System_Kernel": "Kernel:",
|
||||||
"Systeminfo_System_OSVersion": "Operating System:",
|
"Systeminfo_System_OSVersion": "Operating System:",
|
||||||
|
"Systeminfo_System_Running_Processes" : "Running processes:",
|
||||||
"Systeminfo_System_System": "System:",
|
"Systeminfo_System_System": "System:",
|
||||||
"Systeminfo_System_Uname": "Uname:",
|
"Systeminfo_System_Uname": "Uname:",
|
||||||
"Systeminfo_System_Uptime": "Uptime:",
|
"Systeminfo_System_Uptime": "Uptime:",
|
||||||
|
|||||||
@@ -148,6 +148,10 @@
|
|||||||
"DevDetail_Tab_Tools_Speedtest_Title": "Prueba Speedtest",
|
"DevDetail_Tab_Tools_Speedtest_Title": "Prueba Speedtest",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Description": "La herramienta Speedtest mide la velocidad de descarga, la velocidad de subida y la latencia de la conexión a Internet.",
|
"DevDetail_Tab_Tools_Speedtest_Description": "La herramienta Speedtest mide la velocidad de descarga, la velocidad de subida y la latencia de la conexión a Internet.",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Start": "Iniciar Speedtest",
|
"DevDetail_Tab_Tools_Speedtest_Start": "Iniciar Speedtest",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Description": "Traceroute es un comando de diagnóstico de red que se utiliza para rastrear la ruta que toman los paquetes de datos desde un host a otro.<br><br>El comando utiliza el protocolo de mensajes de control de Internet (ICMP) para enviar paquetes a los nodos intermedios en la ruta, cada nodo intermedio responde con un paquete ICMP de tiempo de vida agotado (TTL agotado).<br><br>La salida del comando traceroute muestra la dirección IP de cada nodo intermedio en la ruta.<br><br>El comando traceroute se puede usar para diagnosticar problemas de red, como retrasos, pérdida de paquetes y rutas bloqueadas.<br><br>También se puede usar para identificar la ubicación de un nodo intermedio en una red.",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Start": "Iniciar Traceroute",
|
||||||
|
"DevDetail_Tab_Tools_Traceroute_Error": "Error: la dirección IP no es válida",
|
||||||
"DevDetail_Tab_Nmap" : "<i class=\"fa fa-ethernet\"></i> Nmap",
|
"DevDetail_Tab_Nmap" : "<i class=\"fa fa-ethernet\"></i> Nmap",
|
||||||
"DevDetail_Tab_Sessions" : "<i class=\"fa fa-list-ol\"></i> Sesiones",
|
"DevDetail_Tab_Sessions" : "<i class=\"fa fa-list-ol\"></i> Sesiones",
|
||||||
"DevDetail_Tab_Presence" : "<i class=\"fa fa-calendar\"></i> Historial",
|
"DevDetail_Tab_Presence" : "<i class=\"fa fa-calendar\"></i> Historial",
|
||||||
@@ -642,6 +646,7 @@
|
|||||||
"Systeminfo_System_AVG": "Cargar promedio:",
|
"Systeminfo_System_AVG": "Cargar promedio:",
|
||||||
"Systeminfo_System_Kernel": "Núcleo:",
|
"Systeminfo_System_Kernel": "Núcleo:",
|
||||||
"Systeminfo_System_OSVersion": "Sistema Operativo:",
|
"Systeminfo_System_OSVersion": "Sistema Operativo:",
|
||||||
|
"Systeminfo_System_Running_Processes" : "Procesos corriendo:",
|
||||||
"Systeminfo_System_System": "Sistema:",
|
"Systeminfo_System_System": "Sistema:",
|
||||||
"Systeminfo_System_Uname": "Uname:",
|
"Systeminfo_System_Uname": "Uname:",
|
||||||
"Systeminfo_System_Uptime": "Tiempo de actividad:",
|
"Systeminfo_System_Uptime": "Tiempo de actividad:",
|
||||||
|
|||||||
@@ -29,7 +29,13 @@
|
|||||||
<section class="content">
|
<section class="content">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
//General
|
//General stats
|
||||||
|
// Date & Time
|
||||||
|
$date = new DateTime();
|
||||||
|
$formatted_date = $date->format('l, F j, Y H:i:s'); // Get date
|
||||||
|
$formatted_date2 = $date->format('d/m/Y H:i:s'); // Get date2
|
||||||
|
$formatted_date3 = $date->format('Y/m/d H:i:s'); // Get date3
|
||||||
|
//System stats
|
||||||
// OS-Version
|
// OS-Version
|
||||||
$os_version = '';
|
$os_version = '';
|
||||||
// Raspbian
|
// Raspbian
|
||||||
@@ -38,15 +44,21 @@ if ($os_version == '') {$os_version = exec('cat /etc/os-release | grep PRETTY_NA
|
|||||||
if ($os_version == '') {$os_version = exec('uname -o');}
|
if ($os_version == '') {$os_version = exec('uname -o');}
|
||||||
//$os_version_arr = explode("\n", trim($os_version));
|
//$os_version_arr = explode("\n", trim($os_version));
|
||||||
$stat['os_version'] = str_replace('"', '', str_replace('PRETTY_NAME=', '', $os_version));
|
$stat['os_version'] = str_replace('"', '', str_replace('PRETTY_NAME=', '', $os_version));
|
||||||
$stat['uptime'] = str_replace('up ', '', shell_exec("uptime -p"));
|
$stat['uptime'] = str_replace('up ', '', shell_exec("uptime -p")); // Get system uptime
|
||||||
//Motherboard stat
|
$system_namekernel = shell_exec("uname"); // Get system name kernel
|
||||||
|
$system_namesystem = shell_exec("uname -o"); // Get name system
|
||||||
|
$system_full = shell_exec("uname -a"); // Get system full
|
||||||
|
$system_architecture = shell_exec("uname -m"); // Get system Architecture
|
||||||
|
$load_average = sys_getloadavg(); // Get load average
|
||||||
|
$system_process_count = shell_exec("ps -e --no-headers | wc -l"); // Count processes
|
||||||
|
//Motherboard stats
|
||||||
$motherboard_name = shell_exec('cat /sys/class/dmi/id/board_name'); // Get the Motherboard name
|
$motherboard_name = shell_exec('cat /sys/class/dmi/id/board_name'); // Get the Motherboard name
|
||||||
$motherboard_manufactured = shell_exec('cat /sys/class/dmi/id/board_vendor'); // Get the Motherboard manufactured
|
$motherboard_manufactured = shell_exec('cat /sys/class/dmi/id/board_vendor'); // Get the Motherboard manufactured
|
||||||
$motherboard_revision = shell_exec('cat /sys/class/dmi/id/board_version'); // Get the Motherboard revision
|
$motherboard_revision = shell_exec('cat /sys/class/dmi/id/board_version'); // Get the Motherboard revision
|
||||||
$motherboard_bios = shell_exec('cat /sys/class/dmi/id/bios_version'); // Get the Motherboard BIOS
|
$motherboard_bios = shell_exec('cat /sys/class/dmi/id/bios_version'); // Get the Motherboard BIOS
|
||||||
$motherboard_biosdate = shell_exec('cat /sys/class/dmi/id/bios_date'); // Get the Motherboard BIOS date
|
$motherboard_biosdate = shell_exec('cat /sys/class/dmi/id/bios_date'); // Get the Motherboard BIOS date
|
||||||
$motherboard_biosvendor = shell_exec('cat /sys/class/dmi/id/bios_vendor'); // Get the Motherboard BIOS vendor
|
$motherboard_biosvendor = shell_exec('cat /sys/class/dmi/id/bios_vendor'); // Get the Motherboard BIOS vendor
|
||||||
//CPU stat
|
//CPU stats
|
||||||
$prevVal = shell_exec("cat /proc/cpuinfo | grep processor");
|
$prevVal = shell_exec("cat /proc/cpuinfo | grep processor");
|
||||||
$prevArr = explode("\n", trim($prevVal));
|
$prevArr = explode("\n", trim($prevVal));
|
||||||
$stat['cpu'] = sizeof($prevArr);
|
$stat['cpu'] = sizeof($prevArr);
|
||||||
@@ -83,17 +95,19 @@ $total_memorymb = trim($total_memorymb);
|
|||||||
$total_memorymb = number_format($total_memorymb, 0, '.', '.');
|
$total_memorymb = number_format($total_memorymb, 0, '.', '.');
|
||||||
$mem_used = round(memory_get_usage() / 1048576 * 100, 2);
|
$mem_used = round(memory_get_usage() / 1048576 * 100, 2);
|
||||||
$memory_usage_percent = round(($mem_used / $total_memorymb), 2);
|
$memory_usage_percent = round(($mem_used / $total_memorymb), 2);
|
||||||
//System
|
//HDD stats
|
||||||
$system_namekernel = shell_exec("uname");
|
$hdd_result = shell_exec("df | awk '{print $1}'");
|
||||||
$system_namesystem = shell_exec("uname -o");
|
$hdd_devices = explode("\n", trim($hdd_result));
|
||||||
$system_full = shell_exec("uname -a");
|
$hdd_result = shell_exec("df | awk '{print $2}'");
|
||||||
$system_architecture = shell_exec("uname -m");
|
$hdd_devices_total = explode("\n", trim($hdd_result));
|
||||||
$load_average = sys_getloadavg();
|
$hdd_result = shell_exec("df | awk '{print $3}'");
|
||||||
//Date & Time
|
$hdd_devices_used = explode("\n", trim($hdd_result));
|
||||||
$date = new DateTime();
|
$hdd_result = shell_exec("df | awk '{print $4}'");
|
||||||
$formatted_date = $date->format('l, F j, Y H:i:s');
|
$hdd_devices_free = explode("\n", trim($hdd_result));
|
||||||
$formatted_date2 = $date->format('d/m/Y H:i:s');
|
$hdd_result = shell_exec("df | awk '{print $5}'");
|
||||||
$formatted_date3 = $date->format('Y/m/d H:i:s');
|
$hdd_devices_percent = explode("\n", trim($hdd_result));
|
||||||
|
$hdd_result = shell_exec("df | awk '{print $6}'");
|
||||||
|
$hdd_devices_mount = explode("\n", trim($hdd_result));
|
||||||
//Network stats
|
//Network stats
|
||||||
// Check Server name
|
// Check Server name
|
||||||
if (!empty(gethostname())) { $network_NAME = gethostname(); } else { $network_NAME = lang('Systeminfo_Network_Server_Name_String'); }
|
if (!empty(gethostname())) { $network_NAME = gethostname(); } else { $network_NAME = lang('Systeminfo_Network_Server_Name_String'); }
|
||||||
@@ -110,19 +124,6 @@ $network_result = shell_exec("cat /proc/net/dev | tail -n +3 | awk '{print $2}'"
|
|||||||
$net_interfaces_rx = explode("\n", trim($network_result));
|
$net_interfaces_rx = explode("\n", trim($network_result));
|
||||||
$network_result = shell_exec("cat /proc/net/dev | tail -n +3 | awk '{print $10}'");
|
$network_result = shell_exec("cat /proc/net/dev | tail -n +3 | awk '{print $10}'");
|
||||||
$net_interfaces_tx = explode("\n", trim($network_result));
|
$net_interfaces_tx = explode("\n", trim($network_result));
|
||||||
//HDD stats
|
|
||||||
$hdd_result = shell_exec("df | awk '{print $1}'");
|
|
||||||
$hdd_devices = explode("\n", trim($hdd_result));
|
|
||||||
$hdd_result = shell_exec("df | awk '{print $2}'");
|
|
||||||
$hdd_devices_total = explode("\n", trim($hdd_result));
|
|
||||||
$hdd_result = shell_exec("df | awk '{print $3}'");
|
|
||||||
$hdd_devices_used = explode("\n", trim($hdd_result));
|
|
||||||
$hdd_result = shell_exec("df | awk '{print $4}'");
|
|
||||||
$hdd_devices_free = explode("\n", trim($hdd_result));
|
|
||||||
$hdd_result = shell_exec("df | awk '{print $5}'");
|
|
||||||
$hdd_devices_percent = explode("\n", trim($hdd_result));
|
|
||||||
$hdd_result = shell_exec("df | awk '{print $6}'");
|
|
||||||
$hdd_devices_mount = explode("\n", trim($hdd_result));
|
|
||||||
//USB devices
|
//USB devices
|
||||||
$usb_result = shell_exec("lsusb");
|
$usb_result = shell_exec("lsusb");
|
||||||
$usb_devices_mount = explode("\n", trim($usb_result));
|
$usb_devices_mount = explode("\n", trim($usb_result));
|
||||||
@@ -214,6 +215,10 @@ echo '<div class="box box-solid">
|
|||||||
<div class="col-sm-3 sysinfo_system_a">' . lang('Systeminfo_System_AVG') . '</div>
|
<div class="col-sm-3 sysinfo_system_a">' . lang('Systeminfo_System_AVG') . '</div>
|
||||||
<div class="col-sm-9 sysinfo_system_b">'. $load_average[0] .' '. $load_average[1] .' '. $load_average[2] .'</div>
|
<div class="col-sm-9 sysinfo_system_b">'. $load_average[0] .' '. $load_average[1] .' '. $load_average[2] .'</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3 sysinfo_system_a">' . lang('Systeminfo_System_Running_Processes') . '</div>
|
||||||
|
<div class="col-sm-9 sysinfo_system_b">' . $system_process_count . '</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
@@ -336,12 +341,8 @@ for ($x = 0; $x < sizeof($storage_lsblk_line); $x++) {
|
|||||||
$temp = explode("#", $storage_lsblk_line[$x]);
|
$temp = explode("#", $storage_lsblk_line[$x]);
|
||||||
$storage_lsblk_line[$x] = $temp;
|
$storage_lsblk_line[$x] = $temp;
|
||||||
}
|
}
|
||||||
// echo '<pre>';
|
|
||||||
// print_r($storage_lsblk_line);
|
|
||||||
// echo '</pre>';
|
|
||||||
|
|
||||||
for ($x = 0; $x < sizeof($storage_lsblk_line); $x++) {
|
for ($x = 0; $x < sizeof($storage_lsblk_line); $x++) {
|
||||||
//if (stristr($hdd_devices[$x], '/dev/')) {
|
|
||||||
echo '<div class="row">';
|
echo '<div class="row">';
|
||||||
if (preg_match('~[0-9]+~', $storage_lsblk_line[$x][0])) {
|
if (preg_match('~[0-9]+~', $storage_lsblk_line[$x][0])) {
|
||||||
echo '<div class="col-sm-4 sysinfo_storage_a">"' . lang('Systeminfo_Storage_Mount') . ' ' . $storage_lsblk_line[$x][3] . '"</div>';
|
echo '<div class="col-sm-4 sysinfo_storage_a">"' . lang('Systeminfo_Storage_Mount') . ' ' . $storage_lsblk_line[$x][3] . '"</div>';
|
||||||
@@ -352,7 +353,6 @@ for ($x = 0; $x < sizeof($storage_lsblk_line); $x++) {
|
|||||||
echo '<div class="col-sm-2 sysinfo_storage_b">' . lang('Systeminfo_Storage_Size') . ' ' . $storage_lsblk_line[$x][1] . '</div>';
|
echo '<div class="col-sm-2 sysinfo_storage_b">' . lang('Systeminfo_Storage_Size') . ' ' . $storage_lsblk_line[$x][1] . '</div>';
|
||||||
echo '<div class="col-sm-2 sysinfo_storage_b">' . lang('Systeminfo_Storage_Type') . ' ' . $storage_lsblk_line[$x][2] . '</div>';
|
echo '<div class="col-sm-2 sysinfo_storage_b">' . lang('Systeminfo_Storage_Type') . ' ' . $storage_lsblk_line[$x][2] . '</div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
echo ' </div>
|
echo ' </div>
|
||||||
</div>';
|
</div>';
|
||||||
@@ -365,15 +365,17 @@ echo '<div class="box box-solid">
|
|||||||
<div class="box-body">';
|
<div class="box-body">';
|
||||||
for ($x = 0; $x < sizeof($hdd_devices); $x++) {
|
for ($x = 0; $x < sizeof($hdd_devices); $x++) {
|
||||||
if (stristr($hdd_devices[$x], '/dev/')) {
|
if (stristr($hdd_devices[$x], '/dev/')) {
|
||||||
if ($hdd_devices_total[$x] == 0) {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_total = trim($temp_total);}
|
if (!stristr($hdd_devices[$x], '/loop')) {
|
||||||
if ($hdd_devices_used[$x] == 0) {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_used = trim($temp_total);}
|
if ($hdd_devices_total[$x] == 0 || $hdd_devices_total[$x] == '') {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_total = trim($temp_total);}
|
||||||
if ($hdd_devices_free[$x] == 0) {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_free = trim($temp_total);}
|
if ($hdd_devices_used[$x] == 0 || $hdd_devices_used[$x] == '') {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_used = trim($temp_total);}
|
||||||
|
if ($hdd_devices_free[$x] == 0 || $hdd_devices_free[$x] == '') {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.'); $temp_free = trim($temp_total);}
|
||||||
echo '<div class="row">';
|
echo '<div class="row">';
|
||||||
echo '<div class="col-sm-4 sysinfo_storage_usage_a">"' . lang('Systeminfo_Storage_Usage_Mount') . ' ' . $hdd_devices_mount[$x] . '"</div>';
|
echo '<div class="col-sm-4 sysinfo_storage_usage_a">"' . lang('Systeminfo_Storage_Usage_Mount') . ' ' . $hdd_devices_mount[$x] . '"</div>';
|
||||||
echo '<div class="col-sm-2 sysinfo_storage_usage_b">' . lang('Systeminfo_Storage_Usage_Total') . ' ' . $temp_total . ' GB</div>';
|
echo '<div class="col-sm-2 sysinfo_storage_usage_b">' . lang('Systeminfo_Storage_Usage_Total') . ' ' . $temp_total . ' GB</div>';
|
||||||
echo '<div class="col-sm-3 sysinfo_storage_usage_b">' . lang('Systeminfo_Storage_Usage_Used') . ' ' . $temp_used . ' GB (' . $hdd_devices_percent[$x]. ')</div>';
|
echo '<div class="col-sm-3 sysinfo_storage_usage_b">' . lang('Systeminfo_Storage_Usage_Used') . ' ' . $temp_used . ' GB (' . $hdd_devices_percent[$x]. ')</div>';
|
||||||
echo '<div class="col-sm-2 sysinfo_storage_usage_b">' . lang('Systeminfo_Storage_Usage_Free') . ' ' . $temp_free . ' GB</div>';
|
echo '<div class="col-sm-2 sysinfo_storage_usage_b">' . lang('Systeminfo_Storage_Usage_Free') . ' ' . $temp_free . ' GB</div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#echo '<br>' . $lang['SysInfo_storage_note'];
|
#echo '<br>' . $lang['SysInfo_storage_note'];
|
||||||
@@ -462,7 +464,7 @@ echo '<div class="box box-solid">
|
|||||||
|
|
||||||
for ($x = 0; $x < sizeof($net_interfaces); $x++) {
|
for ($x = 0; $x < sizeof($net_interfaces); $x++) {
|
||||||
$interface_name = str_replace(':', '', $net_interfaces[$x]);
|
$interface_name = str_replace(':', '', $net_interfaces[$x]);
|
||||||
$interface_ip_temp = exec('ip addr show ' . $interface_name . ' | grep inet');
|
$interface_ip_temp = exec('ip addr show ' . $interface_name . ' | grep "inet "');
|
||||||
$interface_ip_arr = explode(' ', trim($interface_ip_temp));
|
$interface_ip_arr = explode(' ', trim($interface_ip_temp));
|
||||||
|
|
||||||
if (!isset($interface_ip_arr[1])) {$interface_ip_arr[1] = '--';}
|
if (!isset($interface_ip_arr[1])) {$interface_ip_arr[1] = '--';}
|
||||||
|
|||||||
Reference in New Issue
Block a user