]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/logs.cgi/log.dat
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / logs.cgi / log.dat
index dacd518a142a6fcb9ebef99e6f8e22aa3fc5c7b2..01c382a0dfbe8bee524b1ffa009a58b7c7ff2af9 100644 (file)
@@ -22,7 +22,7 @@ require "${General::swroot}/header.pl";
 my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 
 use POSIX();
 
@@ -49,40 +49,72 @@ $cgiparams{'ACTION'} = '';
 $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: )',
+        'apcupsd' => '(apcupsd\[.*?\]: )',
+        'auth' => '(\w+\(pam_unix\)\[.*\]: )',
+        'wio' => '(wio:|wio\[.*\])',
+        'captive' => '(Captive:)',
         'clamav' => '(clamd\[.*\]: |freshclam\[.*\]: )',
         'collectd' => '(collectd\[.*\]: )',
         'cron' => '(fcron\[.*\]: )',
-        'ntp' => '(ntpd(?:ate)?\[.*\]: )',
-        'ssh' => '(sshd(?:\(.*\))?\[.*\]: )',
-        'auth' => '(\w+\(pam_unix\)\[.*\]: )',
-        'kernel' => '(kernel: (?!DROP_))',
+        'ddns' => '(ddns\[\d+\]:)',
+        'dhcp' => '(dhcpd: )',
+        'dma' => '(dma: |dma\[.*\]: |postfix/\w*\[\d*\]: )',
+        'guardian' => '(guardian\[.*\]: )',
+        'haproxy' => '(haproxy\[.*?\]: )',
+        'ipblocklist' => '(ipblocklist: )',
+        'ipfire' => '(ipfire: )',
         'ipsec' => '(ipsec_[\w_]+: |pluto\[.*\]: |charon: |vpnwatch: )',
+        'kernel' => '(kernel: (?!DROP_))',
+        'monit' => '(monit\[.*?\]: )',
+        'ntp' => '(ntpd(?:ate)?\[.*\]: )',
+        'nut' => '(upsmon\[.*?\]: )',
+        'oinkmaster' => '(oinkmaster\[.*\]: )',
         'openvpn' => '(openvpnserver\[.*\]: |.*n2n\[.*\]: )',
-        'pakfire' => '(pakfire:) ',
-        'wireless' => '(hostapd:|kernel: ath.*:|kernel: wifi[0-9]:) '
+        'pakfire' => '(pakfire:)',
+        'red' => '(red:|pppd\[.*\]: |chat\[.*\]|pppoe\[.*\]|pptp\[.*\]|pppoa\[.*\]|pppoa3\[.*\]|pppoeci\[.*\]|ipppd|ipppd\[.*\]|kernel: ippp\d|kernel: isdn.*|ibod\[.*\]|dhcpcd\[.*\]|modem_run\[.*\])',
+        'samba' => '(nmbd|smbd|winbind)\[\d+\]:',
+        'suricata' => '(suricata: )',
+        'squid' => '(squid\[.*\]: |squid: )',
+        'ssh' => '(sshd(?:\(.*\))?\[.*\]: )',
+        'unbound' => '(unbound: \[.*?\])(.*:.*$)',
+        'urlfilter bl' => '(installpackage\[urlfilter\]: )',
+        'wireless' => '(hostapd:|kernel: ath.*:|kernel: wifi[0-9]:)',
+               'zabbix_agentd' => '(zabbix_agentd\[.*?\]: )'
         );
 
 # Translations for the %sections array.
 my %trsections = (
-        'ipfire' => 'IPFire',
-        'red' => 'RED',
-        'dns' => 'DNS',
-        'dhcp' => "$Lang::tr{'dhcp server'}",
-        'cron' => 'Cron',
-        'collectd' => 'Collectd',
-                               'clamav' => 'ClamAV',
-        'ntp' => 'NTP',
-        'ssh' => 'SSH',
+        'apcupsd' => 'APCUPS',
         'auth' => "$Lang::tr{'loginlogout'}",
-        'kernel' => "$Lang::tr{'kernel'}",
+        'wio' => 'Who Is Online?',
+        'captive' => $Lang::tr{'Captive'},
+        'clamav' => 'ClamAV',
+        'collectd' => 'Collectd',
+        'cron' => 'Cron',
+        'ddns' => "$Lang::tr{'dynamic dns'}",
+        'dhcp' => "$Lang::tr{'dhcp server'}",
+        'dma' => 'Mail',
+        'guardian' => "$Lang::tr{'guardian'}",
+        'haproxy' => 'HAProxy',
+        'ipblocklist' => "$Lang::tr{'ipblocklist'}",
+        'ipfire' => 'IPFire',
         'ipsec' => 'IPSec',
+        'kernel' => "$Lang::tr{'kernel'}",
+        'monit' => 'Monit',
+        'ntp' => 'NTP',
+        'nut' => 'NUT',
+        'oinkmaster' => 'Oinkmaster',
         'openvpn' => 'OpenVPN',
         'pakfire' => 'Pakfire',
-        'wireless' => 'Wireless'
+        'red' => 'RED',
+        'samba' => $Lang::tr{'samba'},
+        'suricata' => "$Lang::tr{'intrusion detection'}",
+        'squid' => "$Lang::tr{'web proxy'}",
+        'ssh' => 'SSH',
+        'unbound' => 'DNS: Unbound',
+        'urlfilter bl' => 'URLFilter Blacklist',
+        'wireless' => 'Wireless',
+               'zabbix_agentd' => 'Zabbix Agent'
        );
 
 
@@ -190,8 +222,10 @@ while ($gzindex >=0 && $loop) {
         # calculate file name
         if ($gzindex == 0) {
             $filestr = "/var/log/messages";
+            $filestr = "/var/log/mail" if (${section} =~ 'dma');
         } else {
             $filestr = "/var/log/messages.$gzindex";
+            $filestr = "/var/log/mail.$gzindex" if (${section} =~ 'dma');
            $filestr = "$filestr.gz" if -f "$filestr.gz";
         }
        # now read file if existing
@@ -199,8 +233,8 @@ while ($gzindex >=0 && $loop) {
            #&General::log("reading $filestr");
            READ:while (<FILE>) {
                my $line = $_;
-               if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ ${section}(.*)/) {
-                   # when standart viewing, just keep in memory the correct slice
+               if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-\.]+ ${section}(.*)/) {
+                   # when standard viewing, just keep in memory the correct slice
                    # it starts a '$start' and size is $viewport
                    # If export, then keep all lines...
                    if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
@@ -211,7 +245,7 @@ while ($gzindex >=0 && $loop) {
                            if (@log > $Header::viewsize) {
                                shift (@log);
                            }
-                       #} else { dont do this optimisation, need to count lines !
+                       #} else { don't do this optimisation, need to count lines !
                            #    $datetime = $maxtime; # we have read viewsize lines, stop main loop
                            #    last READ;           # exit read file
                        }
@@ -244,7 +278,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
 
        foreach $_ (@log)
        {
-               /^... (..) (..:..:..) [\w\-]+ ${section}(.*)$/;
+               /^... (..) (..:..:..) [\w\-\.]+ ${section}(.*)$/;
                my $day =  $1;
                $day =~ tr / /0/;
                my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
@@ -276,7 +310,7 @@ print <<END
        <select name='SECTION'>
 END
 ;
-foreach $section (keys %sections) {
+foreach $section (sort {$trsections{$a} cmp $trsections{$b}} keys %sections) {
        print "\t<option ";
        if ($section eq $cgiparams{'SECTION'}) {
                print "selected='selected' "; }
@@ -357,8 +391,8 @@ print <<END
 <table width='100%' class='tbl'>
 <tr>
        <th width='10%' align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
-       <th width='10%' align='center' class='boldbase'><b>$Lang::tr{'section'}</b></th>
-       <th width='80%'>&nbsp;</th>
+       <th width='15%' align='center' class='boldbase'><b>$Lang::tr{'section'}</b></th>
+       <th width='75%'>&nbsp;</th>
 </tr>
 END
 ;
@@ -367,7 +401,7 @@ $lines = 0;
 #print '<tt>';
 foreach $_ (@log)
 {
-       /^... (..) (..:..:..) [\w\-]+ ${section}(.*)$/;
+       /^... (..) (..:..:..) [\w\-\.]+ ${section}(.*)$/;
        my $day =  $1;
        $day =~ tr / /0/;
        my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;