]> git.ipfire.org Git - ipfire-2.x.git/blame - html/cgi-bin/fwhits.cgi
Nochmal korrigiert und fwhits auf eine Graphenart eingestellt
[ipfire-2.x.git] / html / cgi-bin / fwhits.cgi
CommitLineData
df8c7810
MT
1#!/usr/bin/perl
2#
3# This code is distributed under the terms of the GPL
4#
5
6use strict;
7
8# enable only the following on debugging purpose
9#use warnings;
10#use CGI::Carp 'fatalsToBrowser';
11
12require '/var/ipfire/general-functions.pl';
13require "${General::swroot}/lang.pl";
14require "${General::swroot}/header.pl";
350b52c5 15require "${General::swroot}/graphs.pl";
df8c7810
MT
16
17my %cgiparams=();
18my @cgigraphs=();
19my @graphs=();
20
350b52c5
CS
21&Graphs::updatefwhitsgraph ("day");
22&Graphs::updatefwhitsgraph ("week");
23&Graphs::updatefwhitsgraph ("month");
24&Graphs::updatefwhitsgraph ("year");
25
df8c7810
MT
26$ENV{'QUERY_STRING'} =~ s/&//g;
27@cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
28$cgigraphs[1] = '' unless defined $cgigraphs[1];
29
30&Header::showhttpheaders();
31
32my $graphdir = "/home/httpd/html/graphs";
df8c7810
MT
33my @LOCALCHECK=();
34my $errormessage="";
35
e455cafe 36&Header::openpage($Lang::tr{'firewall graphs'}, 1, '');
df8c7810 37&Header::openbigbox('100%', 'left', '', $errormessage);
df8c7810 38
986e08d9 39 &Header::openbox('100%', 'center', $Lang::tr{"daily firewallhits"});
df8c7810
MT
40 my $ftime = localtime((stat("$graphdir/firewallhits-day-area.png"))[9]);
41 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 42 print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />";
df8c7810
MT
43 print "<br />\n";
44 &Header::closebox();
45
986e08d9 46 &Header::openbox('100%', 'center', $Lang::tr{"weekly firewallhits"});
df8c7810
MT
47 my $ftime = localtime((stat("$graphdir/firewallhits-week-area.png"))[9]);
48 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 49 print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />";
df8c7810
MT
50 print "<br />\n";
51 &Header::closebox();
52
986e08d9 53 &Header::openbox('100%', 'center', $Lang::tr{"monthly firewallhits"});
df8c7810
MT
54 my $ftime = localtime((stat("$graphdir/firewallhits-month-area.png"))[9]);
55 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 56 print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />";
df8c7810
MT
57 print "<br />\n";
58 &Header::closebox();
59
986e08d9 60 &Header::openbox('100%', 'center', $Lang::tr{"yearly firewallhits"});
df8c7810
MT
61 my $ftime = localtime((stat("$graphdir/firewallhits-year-area.png"))[9]);
62 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 63 print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />";
df8c7810
MT
64 print "<br />\n";
65 &Header::closebox();
df8c7810
MT
66
67&Header::closebigbox();
68&Header::closepage();