]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/fwhits.cgi
3 # This code is distributed under the terms of the GPL
8 # enable only the following on debugging purpose
10 #use CGI::Carp 'fatalsToBrowser';
12 require '/var/ipfire/general-functions.pl';
13 require "${General::swroot}/lang.pl";
14 require "${General::swroot}/header.pl";
20 $ENV{'QUERY_STRING'} =~ s/&//g;
21 @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
22 $cgigraphs[1] = '' unless defined $cgigraphs[1];
24 &Header
::showhttpheaders
();
26 my $graphdir = "/home/httpd/html/graphs";
31 &Header
::openpage
('firewall graphs', 1, ' <META HTTP-EQUIV="Refresh" CONTENT="300"> <META HTTP-EQUIV="Cache-Control" content="no-cache"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> ');
33 &Header
::openbigbox
('100%', 'left', '', $errormessage);
35 <table width="100%" align="center">
38 <a href=/cgi-bin/fwhits.cgi?graph=line>show lines</a>
40 <a href=/cgi-bin/fwhits.cgi?graph=area>show areas</a>
45 if ($cgigraphs[1] eq "line") {
46 &Header
::openbox
('100%', 'center', "daily firewallhits");
47 my $ftime = localtime((stat("$graphdir/firewallhits-day-line.png"))[9]);
48 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
49 print "<img src='/graphs/firewallhits-day-line.png' border='0' />";
53 &Header
::openbox
('100%', 'center', "weekly firewallhits");
54 my $ftime = localtime((stat("$graphdir/firewallhits-week-line.png"))[9]);
55 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
56 print "<img src='/graphs/firewallhits-week-line.png' border='0' />";
60 &Header
::openbox
('100%', 'center', "monthly firewallhits");
61 my $ftime = localtime((stat("$graphdir/firewallhits-month-line.png"))[9]);
62 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
63 print "<img src='/graphs/firewallhits-month-line.png' border='0' />";
67 &Header
::openbox
('100%', 'center', "yearly firewallhits");
68 my $ftime = localtime((stat("$graphdir/firewallhits-year-line.png"))[9]);
69 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
70 print "<img src='/graphs/firewallhits-year-line.png' border='0' />";
76 &Header
::openbox
('100%', 'center', "daily firewallhits");
77 my $ftime = localtime((stat("$graphdir/firewallhits-day-area.png"))[9]);
78 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
79 print "<img src='/graphs/firewallhits-day-area.png' border='0' />";
83 &Header
::openbox
('100%', 'center', "weekly firewallhits");
84 my $ftime = localtime((stat("$graphdir/firewallhits-week-area.png"))[9]);
85 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
86 print "<img src='/graphs/firewallhits-week-area.png' border='0' />";
90 &Header
::openbox
('100%', 'center', "monthly firewallhits");
91 my $ftime = localtime((stat("$graphdir/firewallhits-month-area.png"))[9]);
92 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
93 print "<img src='/graphs/firewallhits-month-area.png' border='0' />";
97 &Header
::openbox
('100%', 'center', "yearly firewallhits");
98 my $ftime = localtime((stat("$graphdir/firewallhits-year-area.png"))[9]);
99 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
100 print "<img src='/graphs/firewallhits-year-area.png' border='0' />";
106 &Header
::closebigbox
();
107 &Header
::closepage
();