diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 00eadc69..4e41ac8a 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -36,6 +36,8 @@ "Equipement", "esata", "Etat", + "Eteindre", + "Etes", "firmver", "Formated", "freebsd", diff --git a/core/class/Monitoring.class.php b/core/class/Monitoring.class.php index 23ff2898..9909f35e 100644 --- a/core/class/Monitoring.class.php +++ b/core/class/Monitoring.class.php @@ -241,12 +241,14 @@ public static function pullCustom($_options) { $mem_stats = config::byKey('configStatsMemCustom', 'Monitoring', '0') == '1' ? true : false; if ($mem_stats) { $mem_start_usage = memory_get_usage(); - log::add('Monitoring', 'info', '[PULLCUSTOM] Memory Usage Start :: ' . round($mem_start_usage / 1024, 2) . ' Ko'); } /** @var Monitoring $Monitoring */ $Monitoring = Monitoring::byId($_options['Monitoring_Id']); if (is_object($Monitoring)) { + if ($mem_stats) { + log::add('Monitoring', 'info', '[' . $Monitoring->getName() .'][PULLCUSTOM] Memory Usage Start :: ' . round($mem_start_usage / 1024, 2) . ' Ko'); + } $cronState = $Monitoring->getCmd(null, 'cron_status'); if (is_object($cronState) && $cronState->execCmd() === 0) { log::add('Monitoring', 'debug', '[' . $Monitoring->getName() .'][PULLCUSTOM] Pull (Custom) :: En Pause'); @@ -270,20 +272,20 @@ public static function pullCustom($_options) { } $Monitoring->refreshWidget(); } + if ($mem_stats) { + $mem_end_usage = memory_get_usage(); + log::add('Monitoring', 'info', '[' . $Monitoring->getName() .'][PULLCUSTOM] Memory Usage End :: ' . round($mem_end_usage / 1024, 2) . ' Ko | Conso :: ' . round(($mem_end_usage - $mem_start_usage) / 1024, 2) . ' Ko'); + } } - if ($mem_stats) { - $mem_end_usage = memory_get_usage(); - log::add('Monitoring', 'info', '[PULLCUSTOM] Memory Usage End :: ' . round($mem_end_usage / 1024, 2) . ' Ko | Conso :: ' . round(($mem_end_usage - $mem_start_usage) / 1024, 2) . ' Ko'); - } } - public static function postConfig_configPullLocal($value) { - log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration PullLocal :: '. $value); - } - + public static function postConfig_configPullLocal($value) { + log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration PullLocal :: ' . $value); + } + public static function postConfig_configPull($value) { - log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration Pull :: '. $value); - } + log::add('Monitoring', 'debug', '[CONFIG-SAVE] Configuration Pull :: ' . $value); + } // Fonction exécutée automatiquement avant la suppression de l'équipement public function preRemove() { @@ -2116,10 +2118,10 @@ public function postSave() { $cron->save(); } else { $cron = cron::byClassAndFunction('Monitoring', 'pullCustom', array('Monitoring_Id' => intval($this->getId()))); - if (is_object($cron)) { - log::add('Monitoring', 'debug', '['. $this->getName() .'][POSTSAVE] Remove CustomPull'); - $cron->remove(); - } + if (is_object($cron)) { + log::add('Monitoring', 'debug', '[' . $this->getName() . '][POSTSAVE] Remove CustomPull'); + $cron->remove(); + } } $this->getInformations(); @@ -2327,9 +2329,11 @@ public function toHtml($_version = 'dashboard') { $replace['#multi_network_cards#'] = template_replace($replace, $multi_network_html); } - // Use a specific template for AsusWRT and default for others + // Use specific templates for AsusWRT, Synology, and default for others if ($this->getConfiguration('asuswrt') == '1') { $template = 'AsusWRT'; + } elseif ($this->getConfiguration('synology') == '1') { + $template = 'Synology'; } else { $template = 'Monitoring'; } diff --git a/core/template/dashboard/AsusWRT.html b/core/template/dashboard/AsusWRT.html index 42cd756a..39ad65ab 100644 --- a/core/template/dashboard/AsusWRT.html +++ b/core/template/dashboard/AsusWRT.html @@ -1,8 +1,12 @@ -
+
+
+
+ + + + + + + + +
+
+ #name_display# #object_name# + #name_display# #object_name# +
+
+ + + +
+
+
+
+ #distri_name_icon# + #distri_name# +
+
+ #uptime_icon# + +
+
+ #load_avg_icon# + +
+
+ #memory_icon# + +
+
+ #swap_icon# + +
+
+ #network_infos_icon# + +
+
+ #network_icon# + +
+ + #multi_network_cards# +
+ #hdd_icon# + +
+
+ #syno_hddv2_icon# + +
+
+ #syno_hddv3_icon# + +
+
+ #syno_hddv4_icon# + +
+
+ #syno_hddusb_icon# + +
+
+ #syno_hddesata_icon# + +
+
+ #cpu_icon# + +
+
+ #perso1_icon# + +
+
+ #perso2_icon# + +
+
+ #perso3_icon# + +
+
+ #perso4_icon# + +
+
+ #divGraphInfo# + +
\ No newline at end of file diff --git a/core/template/mobile/AsusWRT.html b/core/template/mobile/AsusWRT.html index 1a89e011..4c3b425c 100644 --- a/core/template/mobile/AsusWRT.html +++ b/core/template/mobile/AsusWRT.html @@ -1,4 +1,6 @@ -
+
+ + + + + + + + + + + + + + #name_display# + + + + + + + + +
+
+ #distri_name_icon# + #distri_name# +
+
+ #uptime_icon# + +
+
+ #load_avg_icon# + +
+
+ #memory_icon# + +
+
+ #swap_icon# + +
+
+ #network_infos_icon# + +
+
+ #network_icon# + +
+ + #multi_network_cards# +
+ #hdd_icon# + +
+
+ #syno_v2_icon# + +
+
+ #syno_v3_icon# + +
+
+ #syno_v4_icon# + +
+
+ #syno_usb_icon# + +
+
+ #syno_esata_icon# + +
+
+ #cpu_icon# + +
+
+ #perso1_icon# + +
+
+ #perso2_icon# + +
+
+ #perso3_icon# + +
+
+ #perso4_icon# + +
+
+ +
\ No newline at end of file diff --git a/plugin_info/info.json b/plugin_info/info.json index cea69b69..f68d7c2d 100644 --- a/plugin_info/info.json +++ b/plugin_info/info.json @@ -1,7 +1,7 @@ { "id": "Monitoring", "name": "Monitoring", - "pluginVersion": "3.4.1", + "pluginVersion": "3.4.2", "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).",