Hinzugefuegt:

* SquidGuard - mit Patch damit es mit der DB 4.4.20 funktioniert.
  * wput - wget nur andersrum.
  * hddtemp/hddgraph
  * etherwake
  * Saemtliche Bootscripts vom BLFS
  * vpn-restart-script... muss noch bearbeitet werden.
Geaendert:
  * Karsten Rechenbachs Emailadresse in die Credits gebaut.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@168 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-06-10 19:21:32 +00:00
parent 1ce6d69655
commit 60cbd6e755
26 changed files with 1341 additions and 59 deletions

View File

@@ -21,9 +21,7 @@
# Copyright (C) 2004-01-19 Mark Wormgoor <mark@wormgoor.com>. #
# #
############################################################################
#
# $Id: makegraphs,v 1.19.2.18 2006/01/08 13:41:04 eoberlander Exp $
#
use strict;
#use warnings;
@@ -57,6 +55,7 @@ if ((${Lang::language} eq 'el') ||
my $rrdlog = "/var/log/rrd";
my $graphs = "/home/httpd/html/graphs";
$ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
my $hdd_device = "/dev/harddisk";
sub gettraffic {
my $interface = $_[0];
@@ -674,6 +673,75 @@ sub updatelqgraph {
print "Error in RRD::graph for Link Quality: $ERROR\n" if $ERROR;
}
sub updatehdddata
{
if ( ! -e "$rrdlog/hddtemp.rrd")
{
# database did not exist -> create
RRDs::create ("$rrdlog/hddtemp.rrd", "--step=300",
"DS:temperature:GAUGE:600:0:100",
"RRA:AVERAGE:0.5:1:576",
"RRA:AVERAGE:0.5:6:672",
"RRA:AVERAGE:0.5:24:732",
"RRA:AVERAGE:0.5:144:1460");
$ERROR = RRDs::error;
print "Error in RRD::create for hdd: $ERROR\n" if $ERROR;
}
my $hdd_output = `/usr/sbin/hddtemp -qn $hdd_device`;
# I know 4 response possible responses:
#
# /dev/harddisk: harddisk type: S.M.A.R.T. not available
# /dev/harddisk: harddisk type: no sensor
# /dev/harddisk: harddisk type: 37<33>C or <20>F
# 37
if ( index($hdd_output, "S.M.A.R.T.") != -1 )
{
$temp = 0;
}
elsif ( index($hdd_output, "no sensor") != -1 )
{
$temp = 1;
}
elsif ( index($hdd_output, "$hdd_device") != -1 )
{
$hdd_output =~ /.*:.*:\s*(\d+).*\s/;
$temp = $1;
}
else
{
$hdd_output =~ /(\d+)\s/;
$temp = $1;
}
RRDs::update ("$rrdlog/hddtemp.rrd", "-t", "temperature", "N:$temp");
$ERROR = RRDs::error;
print "Error in RRD::update for hdd: $ERROR\n" if $ERROR;
}
sub updatehddgraph {
my $period = $_[0];
RRDs::graph ("$graphs/hddtemp-$period.png",
"--start", "-1$period", "-aPNG", "-i", "-z",
"--alt-y-grid", "-w 600", "-h 100",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#FFFFFF",
"-t $tr{'harddisk temperature'} ($tr{'graph per'} $tr{$period})",
"DEF:temperature=$rrdlog/hddtemp.rrd:temperature:AVERAGE",
"LINE2:temperature#0000FF:$tr{'hdd temperature in'} <20>C",
"GPRINT:temperature:MAX:$tr{'maximal'}\\:%3.0lf <20>C",
"GPRINT:temperature:AVERAGE:$tr{'average'}\\:%3.0lf <20>C",
"GPRINT:temperature:LAST:$tr{'current'}\\:%3.0lf <20>C",
);
$ERROR = RRDs::error;
print "Error in RRD::graph for cpu: $ERROR\n" if $ERROR;
}
## Update ipac logs
system ('/usr/sbin/fetchipac');
sleep 8;
@@ -851,6 +919,15 @@ updatelqgraph("week");
updatelqgraph("month");
updatelqgraph("year");
###
### HDDTEMP-Graphs for /dev/harddisk
###
updatehdddata();
updatehddgraph ("day");
updatehddgraph ("week");
updatehddgraph ("month");
updatehddgraph ("year");
###
### Network Graphs
###