]>
Commit | Line | Data |
---|---|---|
60cbd6e7 MT |
1 | #!/usr/bin/perl |
2 | # | |
3 | # SmoothWall CGIs | |
4 | # | |
5 | # This code is distributed under the terms of the GPL | |
6 | # | |
7 | # (c) The SmoothWall Team | |
8 | # | |
9 | # $Id: graphs.cgi,v 1.9.2.6 2005/02/22 22:21:55 gespinasse Exp $ | |
10 | # | |
11 | # 2006-02-23 modified by weizen_42 for hddgraphs | |
12 | # | |
13 | # 2006-02-xx weizen_42 several modifications | |
14 | # 2006-03-31 weizen_42 link to homepage | |
15 | # 2006-04-22 weizen_42 v0.1.1 install below proxygraphs in status menu | |
16 | # | |
17 | ||
18 | use strict; | |
19 | ||
20 | # enable only the following on debugging purpose | |
21 | #use warnings; | |
22 | #use CGI::Carp 'fatalsToBrowser'; | |
23 | ||
24 | require '/var/ipfire/general-functions.pl'; | |
25 | require "${General::swroot}/lang.pl"; | |
26 | require "${General::swroot}/header.pl"; | |
27 | ||
28 | my $version = 'v0.1.1'; | |
29 | ||
30 | my %cgiparams=(); | |
31 | my @cgigraphs=(); | |
32 | my @graphs=(); | |
33 | ||
34 | &Header::showhttpheaders(); | |
35 | ||
36 | my $graphdir = "/home/httpd/html/graphs"; | |
37 | ||
38 | $ENV{'QUERY_STRING'} =~ s/&//g; | |
39 | @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'}); | |
40 | $cgigraphs[1] = '' unless defined $cgigraphs[1]; | |
41 | ||
42 | &Header::openpage($Lang::tr{'harddisk temperature graphs'}, 1, ''); | |
43 | ||
44 | &Header::openbigbox('100%', 'left'); | |
45 | ||
46 | &Header::openbox('100%', 'center', $Lang::tr{'harddisk temperature'}); | |
47 | ||
48 | if (-e "$graphdir/hddtemp-day.png") | |
49 | { | |
50 | my $ftime = localtime((stat("$graphdir/hddtemp-day.png"))[9]); | |
51 | print "<center>"; | |
52 | print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br /><hr />\n"; | |
53 | print "<img src='/graphs/hddtemp-day.png' border='0' /><hr />"; | |
54 | print "<img src='/graphs/hddtemp-week.png' border='0' /><hr />"; | |
55 | print "<img src='/graphs/hddtemp-month.png' border='0' /><hr />"; | |
56 | print "<img src='/graphs/hddtemp-year.png' border='0' />"; | |
57 | } | |
58 | else | |
59 | { | |
60 | print $Lang::tr{'no information available'}; | |
61 | } | |
62 | ||
63 | &Header::closebox(); | |
64 | ||
65 | &Header::closebigbox(); | |
66 | &Header::closepage(); |