]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - html/cgi-bin/fwhits.cgi
Firewallgraphen angepasst und uebersetzt
[people/pmueller/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"});
3c5695fe
CS
40if (-e "$Header::graphdir/firewallhits-day-area.png") {
41 my $ftime = localtime((stat("$Header::graphdir/firewallhits-day-area.png"))[9]);
df8c7810 42 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 43 print "<img alt='' src='/graphs/firewallhits-day-area.png' border='0' />";
df8c7810 44 print "<br />\n";
3c5695fe
CS
45} else {
46 print $Lang::tr{'no information available'};
47}
48print "<br />\n";
df8c7810 49 &Header::closebox();
3c5695fe 50
986e08d9 51 &Header::openbox('100%', 'center', $Lang::tr{"weekly firewallhits"});
3c5695fe
CS
52if (-e "$Header::graphdir/firewallhits-week-area.png") {
53 my $ftime = localtime((stat("$Header::graphdir/firewallhits-week-area.png"))[9]);
df8c7810 54 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 55 print "<img alt='' src='/graphs/firewallhits-week-area.png' border='0' />";
df8c7810 56 print "<br />\n";
3c5695fe
CS
57} else {
58 print $Lang::tr{'no information available'};
59}
60print "<br />\n";
df8c7810
MT
61 &Header::closebox();
62
986e08d9 63 &Header::openbox('100%', 'center', $Lang::tr{"monthly firewallhits"});
3c5695fe
CS
64if (-e "$Header::graphdir/firewallhits-month-area.png") {
65 my $ftime = localtime((stat("$Header::graphdir/firewallhits-month-area.png"))[9]);
df8c7810 66 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 67 print "<img alt='' src='/graphs/firewallhits-month-area.png' border='0' />";
df8c7810 68 print "<br />\n";
3c5695fe
CS
69} else {
70 print $Lang::tr{'no information available'};
71}
72print "<br />\n";
df8c7810
MT
73 &Header::closebox();
74
986e08d9 75 &Header::openbox('100%', 'center', $Lang::tr{"yearly firewallhits"});
3c5695fe
CS
76if (-e "$Header::graphdir/firewallhits-year-area.png") {
77 my $ftime = localtime((stat("$Header::graphdir/firewallhits-year-area.png"))[9]);
df8c7810 78 print "<center><b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
e455cafe 79 print "<img alt='' src='/graphs/firewallhits-year-area.png' border='0' />";
df8c7810 80 print "<br />\n";
3c5695fe
CS
81} else {
82 print $Lang::tr{'no information available'};
83}
84print "<br />\n";
df8c7810 85 &Header::closebox();
df8c7810
MT
86
87&Header::closebigbox();
88&Header::closepage();