From 239cf5308c8e7eaffd161e23504c8feb5ed172be Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Sun, 9 Nov 2025 20:57:50 +0100 Subject: [PATCH 01/17] Add multi network cards option --- desktop/js/Monitoring.js | 8 ++++++++ desktop/php/Monitoring.php | 14 ++++++++++++++ plugin_info/info.json | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/desktop/js/Monitoring.js b/desktop/js/Monitoring.js index 0611676a..6220a8d8 100644 --- a/desktop/js/Monitoring.js +++ b/desktop/js/Monitoring.js @@ -161,6 +161,14 @@ document.querySelector(".eqLogicAttr[data-l2key='pull_use_custom']").addEventLis } }); +document.querySelector(".eqLogicAttr[data-l2key='multi_if']").addEventListener('change', function () { + if(this.checked){ + document.querySelector(".multi_if_conf").style.display = "block"; + } else { + document.querySelector(".multi_if_conf").style.display = "none"; + } +}); + document.querySelector(".eqLogicAttr[data-l2key='localoudistant']").addEventListener('change', function () { if (this.selectedIndex == 1) { document.querySelector(".distant").style.display = "block"; diff --git a/desktop/php/Monitoring.php b/desktop/php/Monitoring.php index fc473d9b..05738683 100644 --- a/desktop/php/Monitoring.php +++ b/desktop/php/Monitoring.php @@ -337,6 +337,20 @@ +
+ +
+ + ({{A cocher pour monitorer des cartes réseau supplémentaires}}) +
+
+
{{Statistiques}} : diff --git a/plugin_info/info.json b/plugin_info/info.json index 29156218..79bc4977 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "Monitoring", "name": "Monitoring", - "pluginVersion": "3.1.18", + "pluginVersion": "3.2.0", "description": { "fr_FR": "Plugin permettant le monitoring des équipements locaux et distants (via SSH). Le plugin affichera les informations systèmes d'équipements sous Linux ou Synology (Distribution, CPU, Mémoire, Disques, Swap).", "en_US": "Plugin to monitor local and remote equipments (through SSH). The plugin will display system informations from Linux or Synology (Distribution, CPU, Memory, Disks, Swap).", From b490aef80db095766a196001ec8a3fe3c48b83b4 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Sun, 9 Nov 2025 21:00:20 +0100 Subject: [PATCH 02/17] Update Monitoring.php --- desktop/php/Monitoring.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/php/Monitoring.php b/desktop/php/Monitoring.php index 05738683..61e5f257 100644 --- a/desktop/php/Monitoring.php +++ b/desktop/php/Monitoring.php @@ -345,9 +345,9 @@ From 324be1e872c0cf986724577e6a12b8f7fc548d42 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Sun, 9 Nov 2025 22:49:43 +0100 Subject: [PATCH 03/17] Add commands for other network cards --- core/class/Monitoring.class.php | 111 ++++++++++++++++++++++++++++++++ desktop/js/Monitoring.js | 10 ++- 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 3d609d00..cb2a0dea 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -1922,6 +1922,117 @@ public function postSave() { $orderCmd++; } + // Création des commandes pour les cartes réseau supplémentaires + if ($this->getConfiguration('multi_if', '0') == '1') { + $multi_if_list = $this->getConfiguration('multi_if_list', ''); + if (!empty($multi_if_list)) { + // Nettoyer et parser la liste des cartes réseau + $network_cards = array_map('trim', explode(',', $multi_if_list)); + + foreach ($network_cards as $if_name) { + if (empty($if_name)) { + continue; + } + + // Remplacer les caractères spéciaux par des underscores pour le logicalId + $if_safe = preg_replace('/[^a-zA-Z0-9]/', '_', $if_name); + + // Commande network_infos pour cette interface + $MonitoringCmd = $this->getCmd(null, 'network_infos_' . $if_safe); + if (!is_object($MonitoringCmd)) { + $MonitoringCmd = new MonitoringCmd(); + $MonitoringCmd->setName(__('Infos Réseau', __FILE__) . ' (' . $if_name . ')'); + $MonitoringCmd->setEqLogic_id($this->getId()); + $MonitoringCmd->setLogicalId('network_infos_' . $if_safe); + $MonitoringCmd->setType('info'); + $MonitoringCmd->setSubType('string'); + $MonitoringCmd->setDisplay('icon', ''); + $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); + $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); + $MonitoringCmd->setIsVisible(1); + $MonitoringCmd->setOrder($orderCmd++); + $MonitoringCmd->save(); + } else { + $orderCmd++; + } + + // Commande network_tx pour cette interface + $MonitoringCmd = $this->getCmd(null, 'network_tx_' . $if_safe); + if (!is_object($MonitoringCmd)) { + $MonitoringCmd = new MonitoringCmd(); + $MonitoringCmd->setName(__('Réseau (TX)', __FILE__) . ' (' . $if_name . ')'); + $MonitoringCmd->setEqLogic_id($this->getId()); + $MonitoringCmd->setLogicalId('network_tx_' . $if_safe); + $MonitoringCmd->setType('info'); + $MonitoringCmd->setSubType('numeric'); + $MonitoringCmd->setUnite('Mo'); + $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); + $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); + $MonitoringCmd->setIsVisible(0); + $MonitoringCmd->setOrder($orderCmd++); + $MonitoringCmd->save(); + } else { + $orderCmd++; + } + + // Commande network_rx pour cette interface + $MonitoringCmd = $this->getCmd(null, 'network_rx_' . $if_safe); + if (!is_object($MonitoringCmd)) { + $MonitoringCmd = new MonitoringCmd(); + $MonitoringCmd->setName(__('Réseau (RX)', __FILE__) . ' (' . $if_name . ')'); + $MonitoringCmd->setEqLogic_id($this->getId()); + $MonitoringCmd->setLogicalId('network_rx_' . $if_safe); + $MonitoringCmd->setType('info'); + $MonitoringCmd->setSubType('numeric'); + $MonitoringCmd->setUnite('Mo'); + $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); + $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); + $MonitoringCmd->setIsVisible(0); + $MonitoringCmd->setOrder($orderCmd++); + $MonitoringCmd->save(); + } else { + $orderCmd++; + } + + // Commande network_name pour cette interface + $MonitoringCmd = $this->getCmd(null, 'network_name_' . $if_safe); + if (!is_object($MonitoringCmd)) { + $MonitoringCmd = new MonitoringCmd(); + $MonitoringCmd->setName(__('Carte Réseau', __FILE__) . ' (' . $if_name . ')'); + $MonitoringCmd->setEqLogic_id($this->getId()); + $MonitoringCmd->setLogicalId('network_name_' . $if_safe); + $MonitoringCmd->setType('info'); + $MonitoringCmd->setSubType('string'); + $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); + $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); + $MonitoringCmd->setIsVisible(1); + $MonitoringCmd->setOrder($orderCmd++); + $MonitoringCmd->save(); + } else { + $orderCmd++; + } + + // Commande network_ip pour cette interface + $MonitoringCmd = $this->getCmd(null, 'network_ip_' . $if_safe); + if (!is_object($MonitoringCmd)) { + $MonitoringCmd = new MonitoringCmd(); + $MonitoringCmd->setName(__('Adresse IP', __FILE__) . ' (' . $if_name . ')'); + $MonitoringCmd->setEqLogic_id($this->getId()); + $MonitoringCmd->setLogicalId('network_ip_' . $if_safe); + $MonitoringCmd->setType('info'); + $MonitoringCmd->setSubType('string'); + $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); + $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); + $MonitoringCmd->setIsVisible(1); + $MonitoringCmd->setOrder($orderCmd++); + $MonitoringCmd->save(); + } else { + $orderCmd++; + } + } + } + } + if ($this->getConfiguration('pull_use_custom', '0') == '1') { $cron = cron::byClassAndFunction('Monitoring', 'pullCustom', array('Monitoring_Id' => intval($this->getId()))); if (!is_object($cron)) { diff --git a/desktop/js/Monitoring.js b/desktop/js/Monitoring.js index 6220a8d8..4bc87368 100644 --- a/desktop/js/Monitoring.js +++ b/desktop/js/Monitoring.js @@ -57,7 +57,15 @@ function addCmdToTable(_cmd) { tr += ''; tr += ''; - if (['cron_status', 'uptime_sec', 'load_avg_1mn', 'load_avg_5mn', 'load_avg_15mn', 'memory_total', 'memory_used', 'memory_free', 'memory_buffcache', 'memory_available', 'memory_free_percent', 'memory_used_percent', 'memory_available_percent', 'swap_free_percent', 'swap_used_percent', 'swap_total', 'swap_used', 'swap_free', 'network_tx', 'network_rx', 'hdd_total', 'hdd_used', 'hdd_free', 'hdd_used_percent', 'hdd_free_percent', 'cpu_temp', 'perso1', 'perso2', 'perso3', 'perso4', 'syno_hddv2_total', 'syno_hddv2_used', 'syno_hddv2_free', 'syno_hddv2_used_percent', 'syno_hddv2_free_percent', 'syno_hddusb_total', 'syno_hddusb_used', 'syno_hddusb_used_percent', 'syno_hddusb_free', 'syno_hddusb_free_percent', 'syno_hddesata_total', 'syno_hddesata_used', 'syno_hddesata_used_percent', 'syno_hddesata_free', 'syno_hddesata_free_percent', 'asus_clients_total', 'asus_clients_wifi24', 'asus_clients_wifi5', 'asus_clients_wired', 'asus_fw_check', 'asus_wifi2g_temp', 'asus_wifi5g_temp'].includes(init(_cmd.logicalId))) { + // Liste des commandes de base pouvant être historisées + let historizedCommands = ['cron_status', 'uptime_sec', 'load_avg_1mn', 'load_avg_5mn', 'load_avg_15mn', 'memory_total', 'memory_used', 'memory_free', 'memory_buffcache', 'memory_available', 'memory_free_percent', 'memory_used_percent', 'memory_available_percent', 'swap_free_percent', 'swap_used_percent', 'swap_total', 'swap_used', 'swap_free', 'network_tx', 'network_rx', 'hdd_total', 'hdd_used', 'hdd_free', 'hdd_used_percent', 'hdd_free_percent', 'cpu_temp', 'perso1', 'perso2', 'perso3', 'perso4', 'syno_hddv2_total', 'syno_hddv2_used', 'syno_hddv2_free', 'syno_hddv2_used_percent', 'syno_hddv2_free_percent', 'syno_hddusb_total', 'syno_hddusb_used', 'syno_hddusb_used_percent', 'syno_hddusb_free', 'syno_hddusb_free_percent', 'syno_hddesata_total', 'syno_hddesata_used', 'syno_hddesata_used_percent', 'syno_hddesata_free', 'syno_hddesata_free_percent', 'asus_clients_total', 'asus_clients_wifi24', 'asus_clients_wifi5', 'asus_clients_wired', 'asus_fw_check', 'asus_wifi2g_temp', 'asus_wifi5g_temp']; + + // Vérifier si c'est une commande standard ou une commande de carte réseau supplémentaire + let canBeHistorized = historizedCommands.includes(init(_cmd.logicalId)) || + init(_cmd.logicalId).startsWith('network_tx_') || + init(_cmd.logicalId).startsWith('network_rx_'); + + if (canBeHistorized) { tr += ''; } tr += ''; From 7b90cef556f17bad44a3e36082e61ef9a1ca050a Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Sun, 9 Nov 2025 23:55:25 +0100 Subject: [PATCH 04/17] Add cmds to update values for other network cards --- core/class/Monitoring.class.php | 99 +++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 11 deletions(-) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index cb2a0dea..b48a1e76 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -2649,7 +2649,7 @@ public function getRemoteArchKeys($hostId, $osType = '') { return [$archKey, $archSubKey, $archKeyType, $ARMv, $distri_name_value]; } - public function getCommands($key, $subKey = '', $cartereseau = '', $confLocalorRemote = 'local') { + public function getCommands($key, $subKey = '', $cartereseau = '', $cartesreseau_multi = [], $confLocalorRemote = 'local') { if (!empty($subKey)) { log::add('Monitoring', 'debug', '['. $this->getName() .'][getCommands] Key / SubKey (LocalorRemote) :: ' . $key . ' / ' . $subKey . ' (' . $confLocalorRemote . ')'); } else { @@ -2670,8 +2670,10 @@ public function getCommands($key, $subKey = '', $cartereseau = '', $confLocalorR $memory_command = "LC_ALL=C free 2>/dev/null | grep 'Mem' | head -1 | awk '{ print $2,$3,$4,$6,$7 }'"; $swap_command = "LC_ALL=C free 2>/dev/null | awk -F':' '/Swap/ { print $2 }' | awk '{ print $1,$2,$3}'"; - $network_command = "cat /proc/net/dev 2>/dev/null | grep \"" . $cartereseau . ":\" | awk '{ print $1,$2,$10 }' | awk -v ORS=\"\" '{ gsub(/:/, \"\"); print }'"; - $network_ip_command = "LC_ALL=C ip -o -f inet a 2>/dev/null | grep \"" . $cartereseau . " \" | awk '{ print $4 }' | awk -v ORS=\"\" '{ gsub(/\/[0-9]+/, \"\"); print }'"; + $network_command = "cat /proc/net/dev 2>/dev/null | grep \"%s:\" | awk '{ print $1,$2,$10 }' | awk -v ORS=\"\" '{ gsub(/:/, \"\"); print }'"; + $network_ip_command = "LC_ALL=C ip -o -f inet a 2>/dev/null | grep \"%s \" | awk '{ print $4 }' | awk -v ORS=\"\" '{ gsub(/\/[0-9]+/, \"\"); print }'"; + $network_freebsd_command = "netstat -b -i -n -f inet | grep '%s' | awk -v ORS=\"\" '{ print $1,$8,$11 }'"; + $network_ip_freebsd_command = "ifconfig -u %s | awk -v ORS=\"\" '/inet / { print $2 }'"; $load_avg_command = "cat /proc/loadavg 2>/dev/null"; $uptime_command = "awk '{ print $1 }' /proc/uptime 2>/dev/null | awk -v ORS=\"\" '{ gsub(/^[[:space:]]+|[[:space:]]+$/, \"\"); print }'"; $release_command = "awk -F'=' '/%s/ { print $2 }' /etc/*-release 2>/dev/null | awk -v ORS=\"\" '{ gsub(/\"/, \"\"); print }'"; @@ -2706,9 +2708,17 @@ public function getCommands($key, $subKey = '', $cartereseau = '', $confLocalorR 'memory' => $memory_command, 'swap' => $swap_command, 'hdd' => sprintf($hdd_command, '/$'), - 'network' => $network_command, // on récupère le nom de la carte en plus pour l'afficher dans les infos - 'network_ip' => $network_ip_command, + 'network' => sprintf($network_command, $cartereseau), // on récupère le nom de la carte en plus pour l'afficher dans les infos + 'network_ip' => sprintf($network_ip_command, $cartereseau), ]; + + // Ajout des commandes pour les cartes réseau supplémentaires + if (!empty($cartesreseau_multi)) { + foreach ($cartesreseau_multi as $if_safe => $if_name) { + $cmdLocalCommon['network_' . $if_safe] = sprintf($network_command, $if_name); + $cmdLocalCommon['network_ip_' . $if_safe] = sprintf($network_ip_command, $if_name); + } + } // Local Specific $cmdLocalSpecific = [ @@ -2761,9 +2771,17 @@ public function getCommands($key, $subKey = '', $cartereseau = '', $confLocalorR 'load_avg' => $load_avg_command, 'memory' => $memory_command, 'swap' => $swap_command, - 'network' => $network_command, // on récupère le nom de la carte en plus pour l'afficher dans les infos - 'network_ip' => $network_ip_command, + 'network' => sprintf($network_command, $cartereseau), // on récupère le nom de la carte en plus pour l'afficher dans les infos + 'network_ip' => sprintf($network_ip_command, $cartereseau), ]; + + // Ajout des commandes pour les cartes réseau supplémentaires (remote) + if (!empty($cartesreseau_multi)) { + foreach ($cartesreseau_multi as $if_safe => $if_name) { + $cmdRemoteCommon['network_' . $if_safe] = sprintf($network_command, $if_name); + $cmdRemoteCommon['network_ip_' . $if_safe] = sprintf($network_ip_command, $if_name); + } + } // Remote Specific $cmdRemoteSpecific = [ @@ -2848,8 +2866,8 @@ public function getCommands($key, $subKey = '', $cartereseau = '', $confLocalorR 'load_avg' => "sysctl -n vm.loadavg | awk '{ print $2, $3, $4 }'", 'memory' => "total=\$(sysctl -n hw.physmem); pagesize=\$(sysctl -n hw.pagesize); free=\$((\$(sysctl -n vm.stats.vm.v_free_count) * \$pagesize)); inactive=\$(($(sysctl -n vm.stats.vm.v_inactive_count) * \$pagesize)); cache=\$((\$(sysctl -n vm.stats.vm.v_cache_count) * \$pagesize)); wired=\$((\$(sysctl -n vm.stats.vm.v_wire_count) * \$pagesize)); used=\$((\$total - (\$free + \$inactive + \$cache))); available=\$((\$free + \$inactive + \$cache)); echo \"\$total \$used \$free \$cache \$available\"", 'swap' => "swapinfo | awk 'NR>1 {print $2, $3, $4}'", - 'network' => "netstat -b -i -n -f inet | grep '" . $cartereseau . "' | awk -v ORS=\"\" '{ print $1,$8,$11 }'", // on récupère le nom de la carte en plus pour l'afficher dans les infos - 'network_ip' => "ifconfig -u " . $cartereseau . " | awk -v ORS=\"\" '/inet / { print $2 }'", + 'network' => sprintf($network_freebsd_command, $cartereseau), // on récupère le nom de la carte en plus pour l'afficher dans les infos + 'network_ip' => sprintf($network_ip_freebsd_command, $cartereseau), 'cpu_nb' => "sysctl hw.ncpu | awk '{ print $2}'", 'cpu_freq' => [ 1 => ['cmd', "sysctl -n 'dev.cpu.0.freq' 2>/dev/null"], @@ -2955,6 +2973,14 @@ public function getCommands($key, $subKey = '', $cartereseau = '', $confLocalorR 'hdd' => sprintf($hdd_command_qnap, '/share/CACHEDEV[1-9]_DATA$'), ], ]; + + // Ajout des cartes réseau supplémentaires pour FreeBSD + if (!empty($cartesreseau_multi)) { + foreach ($cartesreseau_multi as $if_safe => $if_name) { + $cmdRemoteSpecific['FreeBSD']['network_' . $if_safe] = sprintf($network_freebsd_command, $if_name); + $cmdRemoteSpecific['FreeBSD']['network_ip_' . $if_safe] = sprintf($network_ip_freebsd_command, $if_name); + } + } $cmdRemoteSpecific['armv7l'] = &$cmdRemoteSpecific['aarch64']; // Included OS : OSMC, LibreELEC $cmdRemoteSpecific['mips64'] = &$cmdRemoteSpecific['aarch64']; @@ -3518,6 +3544,21 @@ public function getInformations() { $isQNAP = ($this->getConfiguration('qnap') == '1') ? true : false; $isAsusWRT = ($this->getConfiguration('asuswrt') == '1') ? true : false; + // Préparation de la liste des cartes réseau supplémentaires + $cartesreseau_multi = []; + if ($this->getConfiguration('multi_if', '0') == '1') { + $multi_if_list = $this->getConfiguration('multi_if_list', ''); + if (!empty($multi_if_list)) { + $network_cards = array_map('trim', explode(',', $multi_if_list)); + foreach ($network_cards as $if_name) { + if (!empty($if_name)) { + $if_safe = preg_replace('/[^a-zA-Z0-9]/', '_', $if_name); + $cartesreseau_multi[$if_safe] = $if_name; + } + } + } + } + // Configuration distante if ($confLocalOrRemote == 'distant' && $this->getIsEnable()) { [$cnx_ssh, $hostId] = $this->connectSSH(); @@ -3537,7 +3578,7 @@ public function getInformations() { } $cartereseau = $this->getNetworkCard($this->getConfiguration('cartereseau'), 'remote', $hostId, $archKey); - $commands = $this->getCommands($archKey, $archSubKey, $cartereseau, 'remote'); + $commands = $this->getCommands($archKey, $archSubKey, $cartereseau, $cartesreseau_multi, 'remote'); $ARMv = empty($ARMv) ? ($commands['ARMv'][0] === 'cmd' ? $this->execSSH($hostId, $commands['ARMv'][1], 'ARMv') : $commands['ARMv'][1]) : $ARMv; @@ -3561,6 +3602,18 @@ public function getInformations() { $network_value = $this->execSSH($hostId, $commands['network'], 'ReseauRXTX'); $network_ip_value = $this->execSSH($hostId, $commands['network_ip'], 'ReseauIP'); + + // Récupération des informations des cartes réseau supplémentaires (mode distant) + $multi_if_values = []; + if (!empty($cartesreseau_multi)) { + foreach ($cartesreseau_multi as $if_safe => $if_name) { + $multi_if_values[$if_safe] = [ + 'network_value' => $this->execSSH($hostId, $commands['network_' . $if_safe], 'ReseauRXTX_' . $if_name), + 'network_ip_value' => $this->execSSH($hostId, $commands['network_ip_' . $if_safe], 'ReseauIP_' . $if_name) + ]; + } + } + $cpu_nb = $this->execSSH($hostId, $commands['cpu_nb'], 'NbCPU'); extract($this->getCPUFreq($commands['cpu_freq'], $equipement, 'remote', $hostId)); @@ -3686,7 +3739,7 @@ public function getInformations() { } $cartereseau = $this->getNetworkCard($this->getConfiguration('cartereseau'), 'local'); - $commands = $this->getCommands($archKey, $archSubKey, $cartereseau, 'local'); + $commands = $this->getCommands($archKey, $archSubKey, $cartereseau, $cartesreseau_multi, 'local'); $ARMv = empty($ARMv) ? ($commands['ARMv'][0] === 'cmd' ? $this->execSRV($commands['ARMv'][1], 'ARMv') : $commands['ARMv'][1]) : $ARMv; @@ -3699,6 +3752,18 @@ public function getInformations() { $swap_value = $this->execSRV($commands['swap'], 'Swap'); $network_value = $this->execSRV($commands['network'], 'ReseauRXTX'); $network_ip_value = $this->execSRV($commands['network_ip'], 'ReseauIP'); + + // Récupération des informations des cartes réseau supplémentaires (mode local) + $multi_if_values = []; + if (!empty($cartesreseau_multi)) { + foreach ($cartesreseau_multi as $if_safe => $if_name) { + $multi_if_values[$if_safe] = [ + 'network_value' => $this->execSRV($commands['network_' . $if_safe], 'ReseauRXTX_' . $if_name), + 'network_ip_value' => $this->execSRV($commands['network_ip_' . $if_safe], 'ReseauIP_' . $if_name) + ]; + } + } + $cpu_nb = $this->execSRV($commands['cpu_nb'], 'NbCPU'); extract($this->getHDD($commands['hdd'], $equipement)); @@ -3871,6 +3936,18 @@ public function getInformations() { 'perso3' => $perso3, 'perso4' => $perso4 ); + + // Ajout des données des cartes réseau supplémentaires dans $dataresult + if (!empty($multi_if_values)) { + foreach ($multi_if_values as $if_safe => $if_data) { + [$if_tx, $if_rx, $if_name, $if_ip, $if_network, $if_infos] = $this->formatNetwork($if_data['network_value'], $if_data['network_ip_value'], $equipement); + $dataresult['network_tx_' . $if_safe] = $if_tx; + $dataresult['network_rx_' . $if_safe] = $if_rx; + $dataresult['network_name_' . $if_safe] = $if_name; + $dataresult['network_ip_' . $if_safe] = $if_ip; + $dataresult['network_infos_' . $if_safe] = $if_infos; + } + } $dataresult_stats = array( 'load_avg_1mn' => 2, From bd7818e286fd2713c8a82724fe123186d545968e Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 00:16:06 +0100 Subject: [PATCH 05/17] update templates for other network cards --- core/class/Monitoring.class.php | 70 +++++++++++++++++++++++++ core/template/dashboard/Monitoring.html | 2 + core/template/mobile/Monitoring.html | 2 + 3 files changed, 74 insertions(+) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index b48a1e76..50e49b69 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -2126,6 +2126,23 @@ public function toHtml($_version = 'dashboard') { 'perso4' => array('icon', 'exec', 'id', 'display', 'collect', 'value', 'name', 'unite', 'colorlow', 'colorhigh', 'stats') ); + // Cartes réseau supplémentaires + if ($this->getConfiguration('multi_if', '0') == '1') { + $multi_if_list = $this->getConfiguration('multi_if_list', ''); + if (!empty($multi_if_list)) { + $network_cards = array_map('trim', explode(',', $multi_if_list)); + foreach ($network_cards as $if_name) { + if (!empty($if_name)) { + $if_safe = preg_replace('/[^a-zA-Z0-9]/', '_', $if_name); + $cmdToReplace['network_infos_' . $if_safe] = array('icon', 'exec', 'id', 'display', 'collect', 'value'); + $cmdToReplace['network_' . $if_safe] = array('icon', 'exec', 'id', 'display', 'collect', 'value'); + $cmdToReplace['network_name_' . $if_safe] = array('exec', 'id'); + $cmdToReplace['network_ip_' . $if_safe] = array('exec', 'id'); + } + } + } + } + // Synology if ($this->getConfiguration('synology') == '1') { // Arrays of Synology commands to add if the corresponding option is enabled @@ -2189,6 +2206,59 @@ public function toHtml($_version = 'dashboard') { foreach ($cmdToReplace as $cmdName => $cmdOptions) { $this->getCmdReplace($cmdName, $cmdOptions, $replace); } + + // Génération du HTML pour les cartes réseau supplémentaires + $multi_network_html = ''; + if ($this->getConfiguration('multi_if', '0') == '1') { + $multi_if_list = $this->getConfiguration('multi_if_list', ''); + if (!empty($multi_if_list)) { + $network_cards = array_map('trim', explode(',', $multi_if_list)); + foreach ($network_cards as $if_name) { + if (!empty($if_name)) { + $if_safe = preg_replace('/[^a-zA-Z0-9]/', '_', $if_name); + + // Vérifier si les commandes existent + $cmd_infos = $this->getCmd(null, 'network_infos_' . $if_safe); + $cmd_network = $this->getCmd(null, 'network_' . $if_safe); + + if (is_object($cmd_infos) || is_object($cmd_network)) { + // Format des tooltips selon la version (dashboard ou mobile) + if ($version == 'mobile') { + // Format mobile : utilise || au lieu de
+ $title_infos = 'Infos Réseau (' . $if_name . ') || Date valeur : #network_infos_' . $if_safe . '_value# || Date collecte : #network_infos_' . $if_safe . '_collect#'; + $title_network = 'Trafic Réseau (#network_name_' . $if_safe . '# / #network_ip_' . $if_safe . '#) || Date valeur : #network_' . $if_safe . '_value# || Date collecte : #network_' . $if_safe . '_collect#'; + } else { + // Format dashboard : utilise
+ $title_infos = 'Infos Réseau (' . $if_name . ')
Date de valeur : #network_infos_' . $if_safe . '_value#
Date de collecte : #network_infos_' . $if_safe . '_collect#
'; + $title_network = 'Trafic Réseau (#network_name_' . $if_safe . '# / #network_ip_' . $if_safe . '#)
Date de valeur : #network_' . $if_safe . '_value#
Date de collecte : #network_' . $if_safe . '_collect#
'; + } + + $multi_network_html .= ' + +
+ #network_infos_' . $if_safe . '_icon# + +
+ +
+ #network_' . $if_safe . '_icon# + +
+ '; + } + } + } + } + } + $replace['#multi_network_cards#'] = $multi_network_html; // Commandes Actions foreach ($this->getCmd('action') as $cmd) { diff --git a/core/template/dashboard/Monitoring.html b/core/template/dashboard/Monitoring.html index d1979b04..e412847a 100644 --- a/core/template/dashboard/Monitoring.html +++ b/core/template/dashboard/Monitoring.html @@ -284,6 +284,8 @@ document.getElementById('network#id#').innerHTML = '#network#'; } + + #multi_network_cards#
#hdd_icon# diff --git a/core/template/mobile/Monitoring.html b/core/template/mobile/Monitoring.html index 7b8236a0..b525a877 100644 --- a/core/template/mobile/Monitoring.html +++ b/core/template/mobile/Monitoring.html @@ -247,6 +247,8 @@ document.getElementById('network#id#').innerHTML = '#network#'; } + + #multi_network_cards#
#hdd_icon# From cc707e1c9688a1c589a4a1114390cbe8cef5fca0 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:18:44 +0100 Subject: [PATCH 06/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 50e49b69..aacb0dcc 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -2258,6 +2258,7 @@ public function toHtml($_version = 'dashboard') { } } } + // Le HTML des cartes réseau sera remplacé après que toutes les variables soient définies $replace['#multi_network_cards#'] = $multi_network_html; // Commandes Actions @@ -2265,6 +2266,11 @@ public function toHtml($_version = 'dashboard') { $replace['#cmd_' . $cmd->getLogicalId() . '_id#'] = $cmd->getId(); $replace['#cmd_' . $cmd->getLogicalId() . '_display#'] = (is_object($cmd) && $cmd->getIsVisible()) ? "inline-block" : "none"; } + + // Remplacer les variables dans le HTML des cartes réseau supplémentaires + if (!empty($multi_network_html)) { + $replace['#multi_network_cards#'] = template_replace($replace, $multi_network_html); + } // Use a specific template for AsusWRT and default for others if ($this->getConfiguration('asuswrt') == '1') { From 5176cc2c1ebb4d2eed9cf23daf7dd7e6f345753c Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:22:57 +0100 Subject: [PATCH 07/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index aacb0dcc..24a075ec 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -4021,6 +4021,7 @@ public function getInformations() { $dataresult['network_rx_' . $if_safe] = $if_rx; $dataresult['network_name_' . $if_safe] = $if_name; $dataresult['network_ip_' . $if_safe] = $if_ip; + $dataresult['network_' . $if_safe] = $if_network; $dataresult['network_infos_' . $if_safe] = $if_infos; } } From b1e9f67d4c54db4d657e6d7579990ad75a4a555c Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:25:39 +0100 Subject: [PATCH 08/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 24a075ec..c2992933 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -1956,6 +1956,25 @@ public function postSave() { $orderCmd++; } + // Commande network (TX-RX formaté) pour cette interface + $MonitoringCmd = $this->getCmd(null, 'network_' . $if_safe); + if (!is_object($MonitoringCmd)) { + $MonitoringCmd = new MonitoringCmd(); + $MonitoringCmd->setName(__('Réseau (TX-RX)', __FILE__) . ' (' . $if_name . ')'); + $MonitoringCmd->setEqLogic_id($this->getId()); + $MonitoringCmd->setLogicalId('network_' . $if_safe); + $MonitoringCmd->setType('info'); + $MonitoringCmd->setSubType('string'); + $MonitoringCmd->setDisplay('icon', ''); + $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); + $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); + $MonitoringCmd->setIsVisible(1); + $MonitoringCmd->setOrder($orderCmd++); + $MonitoringCmd->save(); + } else { + $orderCmd++; + } + // Commande network_tx pour cette interface $MonitoringCmd = $this->getCmd(null, 'network_tx_' . $if_safe); if (!is_object($MonitoringCmd)) { From e820b65a0d536f0180e95cd4458986b1ad462995 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:28:43 +0100 Subject: [PATCH 09/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index c2992933..00b801de 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -814,7 +814,8 @@ public function postSave() { $MonitoringCmd->setLogicalId('network'); $MonitoringCmd->setType('info'); $MonitoringCmd->setSubType('string'); - $MonitoringCmd->setDisplay('icon', ''); + // $MonitoringCmd->setDisplay('icon', ''); + $MonitoringCmd->setDisplay('icon', ''); $MonitoringCmd->setDisplay('forceReturnLineBefore', '1'); $MonitoringCmd->setDisplay('forceReturnLineAfter', '1'); $MonitoringCmd->setIsVisible(1); From 94cbedb7c618bc0e161374efa0b9e8c8f869ac01 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:56:26 +0100 Subject: [PATCH 10/17] Add TODO --- .vscode/settings.json | 1 + core/class/Monitoring.class.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8d484bbe..a4056435 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,6 +11,7 @@ "CACHEDEV", "cartereseau", "cartereseauautre", + "cartesreseau", "clientlist", "colorhigh", "colorlow", diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 00b801de..e577e112 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -3821,6 +3821,7 @@ public function getInformations() { $perso4_cmd = $this->getCmdPerso('perso4'); $perso4 = !empty($perso4_cmd) ? $this->execSSH($hostId, $perso4_cmd, 'Perso4') : ''; + // TODO: Ajouter une fermeture de la connexion SSH ici } } elseif ($this->getConfiguration('localoudistant') == 'local' && $this->getIsEnable()) { @@ -4239,6 +4240,8 @@ function getCaseAction($paramaction) { $poweroff = $this->execSSH($hostId, $poweroffcmd, 'PowerOff'); break; } + // TODO: Ajouter une fermeture de la connexion SSH ici + } else { log::add('Monitoring', 'error', '['. $equipement .'][SSH] Reboot/Shutdown :: Connection SSH KO'); } From 27cc2583b37158817112631e07bd0fe605a8c2df Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:36:26 +0100 Subject: [PATCH 11/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index e577e112..4faea030 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -3817,17 +3817,23 @@ public function getInformations() { $perso3_cmd = $this->getCmdPerso('perso3'); $perso3 = !empty($perso3_cmd) ? $this->execSSH($hostId, $perso3_cmd, 'Perso3') : ''; - // Perso4 Command - $perso4_cmd = $this->getCmdPerso('perso4'); - $perso4 = !empty($perso4_cmd) ? $this->execSSH($hostId, $perso4_cmd, 'Perso4') : ''; + // Perso4 Command + $perso4_cmd = $this->getCmdPerso('perso4'); + $perso4 = !empty($perso4_cmd) ? $this->execSSH($hostId, $perso4_cmd, 'Perso4') : ''; - // TODO: Ajouter une fermeture de la connexion SSH ici + // Fermeture explicite de la connexion SSH + if (class_exists('sshmanager') && method_exists('sshmanager', 'closeConnection')) { + try { + sshmanager::closeConnection($hostId); + log::add('Monitoring', 'debug', '['. $this->getName() .'][SSH-CNX] Connexion SSH fermée'); + } catch (Exception $e) { + log::add('Monitoring', 'warning', '['. $this->getName() .'][SSH-CNX] Erreur lors de la fermeture :: ' . $e->getMessage()); + } } } - elseif ($this->getConfiguration('localoudistant') == 'local' && $this->getIsEnable()) { - $cnx_ssh = 'No'; - - [$archKey, $archSubKey, $archKeyType, $ARMv] = $this->getLocalArchKeys(); + } + elseif ($this->getConfiguration('localoudistant') == 'local' && $this->getIsEnable()) { + $cnx_ssh = 'No'; [$archKey, $archSubKey, $archKeyType, $ARMv] = $this->getLocalArchKeys(); if (!empty($archSubKey)) { log::add('Monitoring', 'debug', '['. $equipement .'][LOCAL] ArchKey / ArchSubKey :: ' . $archKey . ' / ' . $archSubKey . ' (' . $archKeyType . ')'); @@ -4240,8 +4246,17 @@ function getCaseAction($paramaction) { $poweroff = $this->execSSH($hostId, $poweroffcmd, 'PowerOff'); break; } - // TODO: Ajouter une fermeture de la connexion SSH ici + // Fermeture explicite de la connexion SSH + if (class_exists('sshmanager') && method_exists('sshmanager', 'closeConnection')) { + try { + sshmanager::closeConnection($hostId); + log::add('Monitoring', 'debug', '['. $equipement .'][SSH-CNX] Connexion SSH fermée'); + } catch (Exception $e) { + log::add('Monitoring', 'warning', '['. $equipement .'][SSH-CNX] Erreur lors de la fermeture :: ' . $e->getMessage()); + } + } + } else { log::add('Monitoring', 'error', '['. $equipement .'][SSH] Reboot/Shutdown :: Connection SSH KO'); } From 37617b163e9c67e1a775a66393320f9a7e945ac9 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 11:37:06 +0100 Subject: [PATCH 12/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 4faea030..b300be82 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -2226,7 +2226,7 @@ public function toHtml($_version = 'dashboard') { foreach ($cmdToReplace as $cmdName => $cmdOptions) { $this->getCmdReplace($cmdName, $cmdOptions, $replace); } - + // Génération du HTML pour les cartes réseau supplémentaires $multi_network_html = ''; if ($this->getConfiguration('multi_if', '0') == '1') { @@ -2236,11 +2236,11 @@ public function toHtml($_version = 'dashboard') { foreach ($network_cards as $if_name) { if (!empty($if_name)) { $if_safe = preg_replace('/[^a-zA-Z0-9]/', '_', $if_name); - + // Vérifier si les commandes existent $cmd_infos = $this->getCmd(null, 'network_infos_' . $if_safe); $cmd_network = $this->getCmd(null, 'network_' . $if_safe); - + if (is_object($cmd_infos) || is_object($cmd_network)) { // Format des tooltips selon la version (dashboard ou mobile) if ($version == 'mobile') { @@ -2252,27 +2252,27 @@ public function toHtml($_version = 'dashboard') { $title_infos = 'Infos Réseau (' . $if_name . ')
Date de valeur : #network_infos_' . $if_safe . '_value#
Date de collecte : #network_infos_' . $if_safe . '_collect#
'; $title_network = 'Trafic Réseau (#network_name_' . $if_safe . '# / #network_ip_' . $if_safe . '#)
Date de valeur : #network_' . $if_safe . '_value#
Date de collecte : #network_' . $if_safe . '_collect#
'; } - + $multi_network_html .= ' - -
- #network_infos_' . $if_safe . '_icon# - -
- -
- #network_' . $if_safe . '_icon# - -
- '; + +
+ #network_infos_' . $if_safe . '_icon# + +
+ +
+ #network_' . $if_safe . '_icon# + +
+ '; } } } From a43afe88daef99cd03326aa462f24ba2ac70312b Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:42:28 +0100 Subject: [PATCH 13/17] Update Monitoring.class.php --- core/class/Monitoring.class.php | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index b300be82..e45b79e5 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -3660,7 +3660,6 @@ public function getInformations() { [$cnx_ssh, $hostId] = $this->connectSSH(); if ($cnx_ssh == 'OK') { - // OS Type $osType = $isSynology ? "Synology" : ($isAsusWRT ? "AsusWRT" : ($isQNAP ? "QNAP" : '')); @@ -3817,23 +3816,25 @@ public function getInformations() { $perso3_cmd = $this->getCmdPerso('perso3'); $perso3 = !empty($perso3_cmd) ? $this->execSSH($hostId, $perso3_cmd, 'Perso3') : ''; - // Perso4 Command - $perso4_cmd = $this->getCmdPerso('perso4'); - $perso4 = !empty($perso4_cmd) ? $this->execSSH($hostId, $perso4_cmd, 'Perso4') : ''; - - // Fermeture explicite de la connexion SSH - if (class_exists('sshmanager') && method_exists('sshmanager', 'closeConnection')) { - try { - sshmanager::closeConnection($hostId); - log::add('Monitoring', 'debug', '['. $this->getName() .'][SSH-CNX] Connexion SSH fermée'); - } catch (Exception $e) { - log::add('Monitoring', 'warning', '['. $this->getName() .'][SSH-CNX] Erreur lors de la fermeture :: ' . $e->getMessage()); + // Perso4 Command + $perso4_cmd = $this->getCmdPerso('perso4'); + $perso4 = !empty($perso4_cmd) ? $this->execSSH($hostId, $perso4_cmd, 'Perso4') : ''; + + // Fermeture explicite de la connexion SSH + if (class_exists('sshmanager') && method_exists('sshmanager', 'closeConnection')) { + try { + sshmanager::closeConnection($hostId); + log::add('Monitoring', 'debug', '['. $this->getName() .'][SSH-CNX] Connexion SSH fermée'); + } catch (Exception $e) { + log::add('Monitoring', 'warning', '['. $this->getName() .'][SSH-CNX] Erreur lors de la fermeture :: ' . $e->getMessage()); + } } } } - } - elseif ($this->getConfiguration('localoudistant') == 'local' && $this->getIsEnable()) { - $cnx_ssh = 'No'; [$archKey, $archSubKey, $archKeyType, $ARMv] = $this->getLocalArchKeys(); + // Configuration locale + elseif ($this->getConfiguration('localoudistant') == 'local' && $this->getIsEnable()) { + $cnx_ssh = 'No'; + [$archKey, $archSubKey, $archKeyType, $ARMv] = $this->getLocalArchKeys(); if (!empty($archSubKey)) { log::add('Monitoring', 'debug', '['. $equipement .'][LOCAL] ArchKey / ArchSubKey :: ' . $archKey . ' / ' . $archSubKey . ' (' . $archKeyType . ')'); @@ -3905,12 +3906,10 @@ public function getInformations() { // Perso4 Command $perso4_cmd = $this->getCmdPerso('perso4'); $perso4 = !empty($perso4_cmd) ? $this->execSRV($perso4_cmd, 'Perso4') : ''; - } // Traitement des données récupérées if (isset($cnx_ssh)) { - // Connexion Local ou Connexion SSH OK if ($this->getConfiguration('localoudistant') == 'local' || $cnx_ssh == 'OK') { From 917e6964e67e7b24397dfa9e80e9148e929ab717 Mon Sep 17 00:00:00 2001 From: TiTidom-RC <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 15:47:22 +0000 Subject: [PATCH 14/17] Auto update translation done by Mips2648/plugins-translations workflow --- core/i18n/de_DE.json | 7 ++++++- core/i18n/en_US.json | 7 ++++++- core/i18n/es_ES.json | 7 ++++++- core/i18n/it_IT.json | 7 ++++++- core/i18n/pt_PT.json | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/core/i18n/de_DE.json b/core/i18n/de_DE.json index c3404a77..5d5cc0fc 100644 --- a/core/i18n/de_DE.json +++ b/core/i18n/de_DE.json @@ -146,6 +146,7 @@ "1er port Wi-Fi": "1. Wi-Fi-Anschluss", "401 - Accès non autorisé": "401 - Unberechtigter Zugriff", "A cocher pour afficher les tendances (statistiques) sur le widget du dashboard": "Anzukreuzen, um Trends (Statistiken) auf dem Dashboard-Widget anzuzeigen", + "A cocher pour monitorer des cartes réseau supplémentaires": "Aktivieren Sie diese Option, um zusätzliche Netzwerkkarten zu überwachen.", "A cocher pour monitorer un NAS QNAP": "Aktivieren Sie diese Option, um ein QNAP-NAS zu überwachen", "A cocher pour monitorer un NAS Synology": "Zur Überwachung eines Synology NAS ankreuzen", "A cocher pour monitorer un Routeur AsusWRT": "Aktivieren Sie diese Option, um einen AsusWRT-Router zu überwachen", @@ -168,6 +169,7 @@ "Auto-Actualisation (Cron)": "Selbstaktualisierung (Cron)", "Autre": "Andere", "Carte Réseau": "Netzwerkkarte", + "Cartes Réseau +": "Netzwerkkarten +", "Catégorie": "Kategorie", "Choisir un hôte dans la liste ou créez en un nouveau": "Wählen Sie einen Host aus der Liste oder erstellen Sie einen neuen", "Cliquer sur ? pour afficher l'assistant cron": "Klicken Sie auf ?, um den Cron-Assistenten anzuzeigen", @@ -202,6 +204,7 @@ "Nom de l'équipement": "Name des Geräts", "Nom de l'équipement Monitoring": "Name des Geräts Monitoring", "Nom de la carte réseau": "Name der Netzwerkkarte", + "Noms des interfaces": "Bezeichnungen der Schnittstellen", "Objet parent": "Übergeordnetes Objekt", "Options": "Optionen", "Port WiFi 2.4G": "2,4-GHz-WLAN-Anschluss", @@ -215,6 +218,7 @@ "Statistiques": "Statistiken", "Supprimer": "Löschen", "Synology": "Synology", + "Séparer les noms par des virgules": "Namen durch Kommas trennen", "Temp (Alt)": "Temp (Alt)", "Tendance": "Trend", "Timeout SRV": "SRV Timeout", @@ -227,7 +231,8 @@ "[ATTENTION] La prochaine version du plugin Monitoring ne supportera plus les versions de Jeedom < \"4.4\".
Veuillez mettre à jour Jeedom pour bénéficier des dernières fonctionnalités.

En attendant, il est conseillé de bloquer les mises à jour du plugin Monitoring.": "[ACHTUNG] Die nächste Version des Monitoring-Plugins wird Jeedom-Versionen < \"4.4\" nicht mehr unterstützen.
Bitte aktualisieren Sie Jeedom, um die neuesten Funktionen zu erhalten.

In der Zwischenzeit ist es ratsam, Updates des Monitoring-Plugins zu blockieren.", "[PLUGIN] Impossible de charger le fichier sshmanager.helper.js (Vérifiez les dépendances)": "[PLUGIN] Die Datei sshmanager.helper.js konnte nicht geladen werden (Überprüfen Sie die Abhängigkeiten)", "[Plugin :: Monitoring] Attention - Version Jeedom !": "[Plugin :: Monitoring] Achtung - Jeedom Version!", - "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2. Ethernet-Anschluss, wlan1: 2. Wi-Fi-Anschluss..." + "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2. Ethernet-Anschluss, wlan1: 2. Wi-Fi-Anschluss...", + "eth2, eth5, enp0s3": "eth2, eth5, enp0s3" }, "plugins\/Monitoring\/plugin_info\/configuration.php": { "Activer ou Désactiver l'affichage des statistiques mémoire de l'équipement local dans les logs": "Aktivieren oder Deaktivieren der Anzeige der Speicherstatistiken des lokalen Geräts in den Protokollen", diff --git a/core/i18n/en_US.json b/core/i18n/en_US.json index 0e2e8121..7d41154b 100644 --- a/core/i18n/en_US.json +++ b/core/i18n/en_US.json @@ -146,6 +146,7 @@ "1er port Wi-Fi": "1st Wi-Fi port", "401 - Accès non autorisé": "401 - Unauthorized access", "A cocher pour afficher les tendances (statistiques) sur le widget du dashboard": "Check to display trends (statistics) on the dashboard widget", + "A cocher pour monitorer des cartes réseau supplémentaires": "Check this box to monitor additional network cards", "A cocher pour monitorer un NAS QNAP": "Check this box to monitor a QNAP NAS", "A cocher pour monitorer un NAS Synology": "Check to monitor a Synology NAS", "A cocher pour monitorer un Routeur AsusWRT": "Check this box to monitor an AsusWRT router", @@ -168,6 +169,7 @@ "Auto-Actualisation (Cron)": "Auto-update (Cron)", "Autre": "Other", "Carte Réseau": "Network card", + "Cartes Réseau +": "Network Cards +", "Catégorie": "Category", "Choisir un hôte dans la liste ou créez en un nouveau": "Choose a host from the list or create a new one", "Cliquer sur ? pour afficher l'assistant cron": "Click on ? to display the cron wizard", @@ -202,6 +204,7 @@ "Nom de l'équipement": "Equipment name", "Nom de l'équipement Monitoring": "Equipment name Monitoring", "Nom de la carte réseau": "Network card name", + "Noms des interfaces": "Interface names", "Objet parent": "Parent object", "Options": "Options", "Port WiFi 2.4G": "2.4G WiFi port", @@ -215,6 +218,7 @@ "Statistiques": "Statistics", "Supprimer": "Delete", "Synology": "Synology", + "Séparer les noms par des virgules": "Separate names with commas", "Temp (Alt)": "Temp (Alt)", "Tendance": "Trend", "Timeout SRV": "Timeout SRV", @@ -227,7 +231,8 @@ "[ATTENTION] La prochaine version du plugin Monitoring ne supportera plus les versions de Jeedom < \"4.4\".
Veuillez mettre à jour Jeedom pour bénéficier des dernières fonctionnalités.

En attendant, il est conseillé de bloquer les mises à jour du plugin Monitoring.": "[ATTENTION] The next version of the Monitoring plugin will no longer support Jeedom versions < \"4.4\".
Please update Jeedom to benefit from the latest features.

In the meantime, it is advisable to block updates to the Monitoring plugin.", "[PLUGIN] Impossible de charger le fichier sshmanager.helper.js (Vérifiez les dépendances)": "[PLUGIN] Unable to load sshmanager.helper.js (Check dependencies)", "[Plugin :: Monitoring] Attention - Version Jeedom !": "[Plugin :: Monitoring] Warning - Jeedom version!", - "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2nd Ethernet port, wlan1: 2nd Wi-Fi port..." + "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2nd Ethernet port, wlan1: 2nd Wi-Fi port...", + "eth2, eth5, enp0s3": "eth2, eth5, enp0s3" }, "plugins\/Monitoring\/plugin_info\/configuration.php": { "Activer ou Désactiver l'affichage des statistiques mémoire de l'équipement local dans les logs": "Enable or disable the display of local device memory statistics in logs", diff --git a/core/i18n/es_ES.json b/core/i18n/es_ES.json index 9d44a97a..73fe3a8d 100644 --- a/core/i18n/es_ES.json +++ b/core/i18n/es_ES.json @@ -146,6 +146,7 @@ "1er port Wi-Fi": "1er puerto Wi-Fi", "401 - Accès non autorisé": "401 - Acceso no autorizado", "A cocher pour afficher les tendances (statistiques) sur le widget du dashboard": "Marca para mostrar tendencias (estadísticas) en el widget del panel de control", + "A cocher pour monitorer des cartes réseau supplémentaires": "Marque esta casilla para supervisar tarjetas de red adicionales.", "A cocher pour monitorer un NAS QNAP": "Marcar para supervisar un NAS QNAP", "A cocher pour monitorer un NAS Synology": "Comprobación para supervisar un Synology NAS", "A cocher pour monitorer un Routeur AsusWRT": "Marcar para supervisar un router AsusWRT", @@ -168,6 +169,7 @@ "Auto-Actualisation (Cron)": "Actualización automática (Cron)", "Autre": "Otros", "Carte Réseau": "Tarjeta de red", + "Cartes Réseau +": "Tarjetas de red +", "Catégorie": "Categoría", "Choisir un hôte dans la liste ou créez en un nouveau": "Elija un host de la lista o cree uno nuevo", "Cliquer sur ? pour afficher l'assistant cron": "Haga clic en ? para mostrar el asistente de cron", @@ -202,6 +204,7 @@ "Nom de l'équipement": "Nombre del equipo", "Nom de l'équipement Monitoring": "Nombre del equipo Supervisión", "Nom de la carte réseau": "Nombre de la tarjeta de red", + "Noms des interfaces": "Nombres de las interfaces", "Objet parent": "Objeto principal", "Options": "Opciones", "Port WiFi 2.4G": "Puerto WiFi 2.4G", @@ -215,6 +218,7 @@ "Statistiques": "Estadísticas", "Supprimer": "Borrar", "Synology": "Synology", + "Séparer les noms par des virgules": "Separe los nombres con comas.", "Temp (Alt)": "Temp (Alt)", "Tendance": "Tendencias", "Timeout SRV": "Tiempo de espera SRV", @@ -227,7 +231,8 @@ "[ATTENTION] La prochaine version du plugin Monitoring ne supportera plus les versions de Jeedom < \"4.4\".
Veuillez mettre à jour Jeedom pour bénéficier des dernières fonctionnalités.

En attendant, il est conseillé de bloquer les mises à jour du plugin Monitoring.": "[AVISO] La próxima versión del plugin de Monitorización dejará de ser compatible con versiones de Jeedom < \"4.4\".
Por favor, actualice Jeedom para beneficiarse de las últimas funcionalidades.

Mientras tanto, es recomendable bloquear las actualizaciones del plugin de Monitorización.", "[PLUGIN] Impossible de charger le fichier sshmanager.helper.js (Vérifiez les dépendances)": "[PLUGIN] No se puede cargar sshmanager.helper.js (Comprobar dependencias)", "[Plugin :: Monitoring] Attention - Version Jeedom !": "[Plugin :: Monitorización] Advertencia - ¡Versión Jeedom!", - "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2º puerto Ethernet, wlan1: 2º puerto Wi-Fi..." + "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2º puerto Ethernet, wlan1: 2º puerto Wi-Fi...", + "eth2, eth5, enp0s3": "eth2, eth5, enp0s3" }, "plugins\/Monitoring\/plugin_info\/configuration.php": { "Activer ou Désactiver l'affichage des statistiques mémoire de l'équipement local dans les logs": "Activar o desactivar la visualización de las estadísticas de memoria del equipo local en los registros.", diff --git a/core/i18n/it_IT.json b/core/i18n/it_IT.json index eb3fd0bc..11eae3a8 100644 --- a/core/i18n/it_IT.json +++ b/core/i18n/it_IT.json @@ -146,6 +146,7 @@ "1er port Wi-Fi": "1a porta Wi-Fi", "401 - Accès non autorisé": "401 - Accesso non autorizzato", "A cocher pour afficher les tendances (statistiques) sur le widget du dashboard": "Spunta per visualizzare i trend (statistiche) sul widget del cruscotto", + "A cocher pour monitorer des cartes réseau supplémentaires": "Da selezionare per monitorare schede di rete aggiuntive", "A cocher pour monitorer un NAS QNAP": "Da selezionare per monitorare un NAS QNAP", "A cocher pour monitorer un NAS Synology": "Controllare per monitorare un NAS Synology", "A cocher pour monitorer un Routeur AsusWRT": "Da selezionare per monitorare un router AsusWRT", @@ -168,6 +169,7 @@ "Auto-Actualisation (Cron)": "Aggiornamento automatico (Cron)", "Autre": "Altro", "Carte Réseau": "Scheda di rete", + "Cartes Réseau +": "Schede di rete +", "Catégorie": "Categoria", "Choisir un hôte dans la liste ou créez en un nouveau": "Scegliere un host dall'elenco o crearne uno nuovo", "Cliquer sur ? pour afficher l'assistant cron": "Fare clic su ? per visualizzare la procedura guidata di cron", @@ -202,6 +204,7 @@ "Nom de l'équipement": "Nome dell'apparecchiatura", "Nom de l'équipement Monitoring": "Nome dell'apparecchiatura Monitoraggio", "Nom de la carte réseau": "Nome della scheda di rete", + "Noms des interfaces": "Nomi delle interfacce", "Objet parent": "Oggetto genitore", "Options": "Opzioni", "Port WiFi 2.4G": "Porta WiFi 2.4G", @@ -215,6 +218,7 @@ "Statistiques": "Statistiche", "Supprimer": "Cancellare", "Synology": "Synology", + "Séparer les noms par des virgules": "Separare i nomi con virgole", "Temp (Alt)": "Temperatura (Alt)", "Tendance": "Tendenze", "Timeout SRV": "Timeout SRV", @@ -227,7 +231,8 @@ "[ATTENTION] La prochaine version du plugin Monitoring ne supportera plus les versions de Jeedom < \"4.4\".
Veuillez mettre à jour Jeedom pour bénéficier des dernières fonctionnalités.

En attendant, il est conseillé de bloquer les mises à jour du plugin Monitoring.": "[La prossima versione del plugin Monitoring non supporterà più le versioni di Jeedom < \"4.4\".
Si prega di aggiornare Jeedom per usufruire delle ultime funzionalità.

Nel frattempo, si consiglia di bloccare gli aggiornamenti del plugin Monitoring.", "[PLUGIN] Impossible de charger le fichier sshmanager.helper.js (Vérifiez les dépendances)": "[PLUGIN] Impossibile caricare sshmanager.helper.js (controllare le dipendenze)", "[Plugin :: Monitoring] Attention - Version Jeedom !": "[Plugin :: Monitoraggio] Attenzione - versione Jeedom!", - "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: seconda porta Ethernet, wlan1: seconda porta Wi-Fi..." + "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: seconda porta Ethernet, wlan1: seconda porta Wi-Fi...", + "eth2, eth5, enp0s3": "eth2, eth5, enp0s3" }, "plugins\/Monitoring\/plugin_info\/configuration.php": { "Activer ou Désactiver l'affichage des statistiques mémoire de l'équipement local dans les logs": "Attivare o disattivare la visualizzazione delle statistiche di memoria dell'apparecchiatura locale nei log", diff --git a/core/i18n/pt_PT.json b/core/i18n/pt_PT.json index a3b8c42f..b9eb2e7d 100644 --- a/core/i18n/pt_PT.json +++ b/core/i18n/pt_PT.json @@ -146,6 +146,7 @@ "1er port Wi-Fi": "1ª porta Wi-Fi", "401 - Accès non autorisé": "401 - Acesso não autorizado", "A cocher pour afficher les tendances (statistiques) sur le widget du dashboard": "Assinalar para apresentar tendências (estatísticas) no widget do painel de controlo", + "A cocher pour monitorer des cartes réseau supplémentaires": "Marque esta opção para monitorizar placas de rede adicionais", "A cocher pour monitorer un NAS QNAP": "Marque esta opção para monitorizar um NAS QNAP", "A cocher pour monitorer un NAS Synology": "Verificação para monitorizar um Synology NAS", "A cocher pour monitorer un Routeur AsusWRT": "Marque esta opção para monitorizar um router AsusWRT", @@ -168,6 +169,7 @@ "Auto-Actualisation (Cron)": "Atualização automática (Cron)", "Autre": "Outros", "Carte Réseau": "Placa de rede", + "Cartes Réseau +": "Placas de rede +", "Catégorie": "Categoria", "Choisir un hôte dans la liste ou créez en un nouveau": "Escolha um anfitrião da lista ou crie um novo", "Cliquer sur ? pour afficher l'assistant cron": "Clique em ? para visualizar o assistente de cron", @@ -202,6 +204,7 @@ "Nom de l'équipement": "Nome do equipamento", "Nom de l'équipement Monitoring": "Nome do equipamento Monitorização", "Nom de la carte réseau": "Nome da placa de rede", + "Noms des interfaces": "Nomes das interfaces", "Objet parent": "Objeto principal", "Options": "Opções", "Port WiFi 2.4G": "Porta WiFi 2.4G", @@ -215,6 +218,7 @@ "Statistiques": "Estatísticas", "Supprimer": "Eliminar", "Synology": "Synology", + "Séparer les noms par des virgules": "Separe os nomes por vírgulas", "Temp (Alt)": "Temp (Alt)", "Tendance": "Tendências", "Timeout SRV": "Tempo limite SRV", @@ -227,7 +231,8 @@ "[ATTENTION] La prochaine version du plugin Monitoring ne supportera plus les versions de Jeedom < \"4.4\".
Veuillez mettre à jour Jeedom pour bénéficier des dernières fonctionnalités.

En attendant, il est conseillé de bloquer les mises à jour du plugin Monitoring.": "[AVISO] A próxima versão do plugin de Monitorização deixará de suportar as versões do Jeedom < \"4.4\".
Por favor, actualize o Jeedom para beneficiar das últimas funcionalidades.

Entretanto, é aconselhável bloquear as actualizações do plugin de Monitorização.", "[PLUGIN] Impossible de charger le fichier sshmanager.helper.js (Vérifiez les dépendances)": "[PLUGIN] Não foi possível carregar sshmanager.helper.js (Verificar dependências)", "[Plugin :: Monitoring] Attention - Version Jeedom !": "[Plugin :: Monitorização] Aviso - Versão do Jeedom!", - "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2ª porta Ethernet, wlan1: 2ª porta Wi-Fi..." + "eth1 : 2ème port Ethernet, wlan1 : 2ème port Wi-Fi...": "eth1: 2ª porta Ethernet, wlan1: 2ª porta Wi-Fi...", + "eth2, eth5, enp0s3": "eth2, eth5, enp0s3" }, "plugins\/Monitoring\/plugin_info\/configuration.php": { "Activer ou Désactiver l'affichage des statistiques mémoire de l'équipement local dans les logs": "Ativar ou desativar a exibição das estatísticas de memória do equipamento local nos registos", From 3cbe8648d092a4a044b2666648df8ccdee4ee921 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:08:48 +0100 Subject: [PATCH 15/17] Update GitHub Actions PHP linting version --- .github/workflows/checkPHP.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkPHP.yml b/.github/workflows/checkPHP.yml index 5a71f971..a6cbfbe3 100644 --- a/.github/workflows/checkPHP.yml +++ b/.github/workflows/checkPHP.yml @@ -12,8 +12,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: PHP Syntax Checker (Lint) - uses: StephaneBour/actions-php-lint@8.1 + uses: StephaneBour/actions-php-lint@8.2 with: dir: '.' From 9242089690c60d22307ecb5444fc8f0c37fdc2f7 Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Tue, 11 Nov 2025 15:06:27 +0100 Subject: [PATCH 16/17] update network_ip value if empty --- .vscode/settings.json | 1 + core/class/Monitoring.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a4056435..e7d6b117 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,6 +34,7 @@ "Etat", "firmver", "Formated", + "freebsd", "getcfg", "getconf", "getconfiguration", diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index e45b79e5..18a46d5f 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -3321,7 +3321,7 @@ public function formatCPU($_cpu_nb, $_cpu_freq, $_cpu_temp, $_OS, $_equipement) public function formatNetwork($_network_txrx, $_network_ip, $_equipement) { // Network TX, Network RX, Network Name, Network Ip, Text - $network_ip = isset($_network_ip) ? $_network_ip : ''; + $network_ip = isset($_network_ip) && !empty($_network_ip) ? $_network_ip : 'N/A'; // Init result $result = [0.00, 0.00, '', $network_ip, '', '']; From 3cb50e5a1526425b82359e9d3be028595dc03eeb Mon Sep 17 00:00:00 2001 From: Olivier <16240457+TiTidom-RC@users.noreply.github.com> Date: Tue, 11 Nov 2025 15:06:43 +0100 Subject: [PATCH 17/17] Update info.json --- plugin_info/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_info/info.json b/plugin_info/info.json index 79bc4977..2e97459d 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "Monitoring", "name": "Monitoring", - "pluginVersion": "3.2.0", + "pluginVersion": "3.2.1", "description": { "fr_FR": "Plugin permettant le monitoring des équipements locaux et distants (via SSH). Le plugin affichera les informations systèmes d'équipements sous Linux ou Synology (Distribution, CPU, Mémoire, Disques, Swap).", "en_US": "Plugin to monitor local and remote equipments (through SSH). The plugin will display system informations from Linux or Synology (Distribution, CPU, Memory, Disks, Swap).",