Enhancement #3069

IPS: dashboard optimization

Added by Giacomo Sanchietti over 6 years ago. Updated over 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-snort
Target version:~FUTURE
Resolution:DUPLICATE NEEDINFO:No

Description

Every time the Dashboard is loaded, the IPS tab calls snortalog.
This process slows down the entire Dashboard and should be avoided.

Also, display the list of available logs from the newest to the oldest one.


Related issues

Duplicates NethServer 6 - Enhancement #2864: Dashboard: execute snortalog only when accessing IPS tab CLOSED

History

#1 Updated by Giacomo Sanchietti over 6 years ago

  • Category set to nethserver-snort

#2 Updated by Giacomo Sanchietti over 6 years ago

Tested fix:

--- /usr/share/nethesis/NethServer/Module/Dashboard/IPS.php.ori    2015-03-03 14:13:23.395024779 +0100
+++ /usr/share/nethesis/NethServer/Module/Dashboard/IPS.php    2015-03-03 14:19:36.698516603 +0100
@@ -45,7 +45,7 @@
                 $logs[] = $log;
             }
         }
-
+        sort($logs);
         return $logs;
     }

@@ -79,7 +79,7 @@
             $this->logs = $this->listLogs();
         }

-        $view['logsDatasource'] =  array_map(function($fmt) use ($view) {
+        $tmp =  array_map(function($fmt) use ($view) {
             if ($fmt == 'alert') {
                 $label = $view->translate('log_current');
             } else {
@@ -88,11 +88,10 @@
             }
             return array($fmt, $label);
         }, $this->logs);
+        array_unshift($tmp, array('-','-'));
+        $view['logsDatasource'] =  $tmp;

-        if (!$this->report) {
-            $this->report = $this->getReport();
-        }
         $view['report'] = $this->report;
     }
 }

#3 Updated by Giacomo Sanchietti over 6 years ago

  • Related to Enhancement #2864: Dashboard: execute snortalog only when accessing IPS tab added

#4 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from NEW to CLOSED
  • % Done changed from 0 to 100
  • Resolution set to DUPLICATE

Duplicate of #2864

#5 Updated by Davide Principi over 6 years ago

  • Related to deleted (Enhancement #2864: Dashboard: execute snortalog only when accessing IPS tab)

#6 Updated by Davide Principi over 6 years ago

  • Duplicates Enhancement #2864: Dashboard: execute snortalog only when accessing IPS tab added

#7 Updated by Davide Principi over 6 years ago

  • Target version set to ~FUTURE

Also available in: Atom PDF