]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/logs.cgi/log.dat
Some Fixes for the CGIs not spamming apache logfile.
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / logs.cgi / log.dat
index 3c408a78fa25feee2efaee7be0b6d11bd483f753..fea9e6bf1e636d30dba894ce0b3f762f465623ce 100644 (file)
@@ -26,10 +26,6 @@ my %mainsettings = ();
 
 use POSIX();
 
-#workaround to suppress a warning when a variable is used only once
-my @dummy = ( ${Header::table2colour} );
-undef (@dummy);
-
 my %cgiparams=();
 my %logsettings=();
 my $errormessage = '';
@@ -50,20 +46,24 @@ my $year = $now[5]+1900;
 $cgiparams{'DAY'} = $now[3];
 $cgiparams{'MONTH'} = $now[4];
 $cgiparams{'ACTION'} = '';
-$cgiparams{'SECTION'} = 'kernel';
+$cgiparams{'SECTION'} = 'ipfire';
 
 my %sections = (
         'ipfire' => '(ipfire: )',
         'red' => '(red:|pppd\[.*\]: |chat\[.*\]|pppoe\[.*\]|pptp\[.*\]|pppoa\[.*\]|pppoa3\[.*\]|pppoeci\[.*\]|ipppd|ipppd\[.*\]|kernel: ippp\d|kernel: isdn.*|ibod\[.*\]|dhcpcd\[.*\]|modem_run\[.*\])',
         'dns' => '(dnsmasq\[.*\]: )',
         'dhcp' => '(dhcpd: )',
+        'clamav' => '(clamd\[.*\]: |freshclam\[.*\]: )',
+        'collectd' => '(collectd\[.*\]: )',
         'cron' => '(fcron\[.*\]: )',
         'ntp' => '(ntpd(?:ate)?\[.*\]: )',
         'ssh' => '(sshd(?:\(.*\))?\[.*\]: )',
         'auth' => '(\w+\(pam_unix\)\[.*\]: )',
-        'kernel' => '(kernel: (?!DROP-))',
+        'kernel' => '(kernel: (?!DROP_))',
         'ipsec' => '(ipsec_[\w_]+: |pluto\[.*\]: |vpnwatch: )',
-        'openvpn' => '(openvpnserver)\[.*\]: '
+        'openvpn' => '(openvpnserver)\[.*\]: ',
+        'pakfire' => '(pakfire:) ',
+        'wireless' => '(hostapd:|kernel: ath.*:|kernel: wifi[0-9]:) '
         );
 
 # Translations for the %sections array.
@@ -73,12 +73,16 @@ my %trsections = (
         'dns' => 'DNS',
         'dhcp' => "$Lang::tr{'dhcp server'}",
         'cron' => 'Cron',
+        'collectd' => 'Collectd',
+                               'clamav' => 'ClamAV',
         'ntp' => 'NTP',
         'ssh' => 'SSH',
         'auth' => "$Lang::tr{'loginlogout'}",
         'kernel' => "$Lang::tr{'kernel'}",
         'ipsec' => 'IPSec',
         'openvpn' => 'OpenVPN',
+        'pakfire' => 'Pakfire',
+        'wireless' => 'Wireless'
        );
 
 
@@ -149,7 +153,7 @@ my $date = $cgiparams{'DAY'} == 0 ? '' :  $cgiparams{'DAY'} <= 9 ? "0$cgiparams{
 
 {
     my $xday;
-    
+
     # Calculate time. If future date, calculate for past year !!!
     if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
         ( $cgiparams{'MONTH'}  > $now[4] ) ) {
@@ -163,13 +167,13 @@ my $date = $cgiparams{'DAY'} == 0 ? '' :  $cgiparams{'DAY'} <= 9 ? "0$cgiparams{
     # calculate end of active week (saturday 23H59)
     my @then = ();
     @then = localtime(time());
-    my $sunday = POSIX::mktime( 0, 0, 0, @then[3], @then[4], @then[5]);
+    my $sunday = POSIX::mktime( 0, 0, 0, $then[3], $then[4], $then[5]);
     $sunday += (6-$then[6]) * 86400;
 
     # Convert delta in second to full weeks
        $gzindex = int (($sunday-$xday)/604800 );
 }
-                                                                                          
+
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
 my $daystr =  $cgiparams{'DAY'} == 0 ?  '..' : $cgiparams{'DAY'} <= 9 ? " $cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
 my $section = $sections{$cgiparams{'SECTION'}};
@@ -181,7 +185,7 @@ my $loop = 1;
 my $filestr = 0;
 my $lastdatetime;           # for debug
 my $search_for_end = 0;
-           
+
 while ($gzindex >=0 && $loop) {
         # calculate file name
         if ($gzindex == 0) {
@@ -302,7 +306,7 @@ print <<END
 END
 ;
 print "<option value='0'>$Lang::tr{'all'}</option>\n";
-for (my $day = 1; $day <= 31; $day++) 
+for (my $day = 1; $day <= 31; $day++)
 {
        print "\t<option ";
        if ($day == $cgiparams{'DAY'}) {
@@ -337,7 +341,7 @@ my $prev;
        $prev = $start - ${Header::viewsize};
        $prev = 0 if ( $prev < 0);
     }
-                                   
+
 my $next;
     if ($start == $lines - ${Header::viewsize}) {
         $next = -1;