From: Maniacikarus Date: Sun, 28 Sep 2008 12:19:43 +0000 (+0200) Subject: Changed makegraphs to rrdlog X-Git-Tag: v2.3-beta4~14^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42ae148e5c4fd0600ecb3191e0c7532902d6529c;p=ipfire-2.x.git Changed makegraphs to rrdlog --- diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index cfe5f8fa39..72bf77dbad 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -32,7 +32,6 @@ require "${General::swroot}/lang.pl"; # Settings $ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; my $temp = ''; -my $rrdlog = '/var/log/rrd'; my $ERROR; my $path_smartctl = "/usr/sbin/smartctl"; @@ -49,7 +48,7 @@ sub updatehdddata if ( ! -e "$rrdlog/hddshutdown-".$array[$#array].".rrd"){ # database did not exist -> create - RRDs::create ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "--step=300", + RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300", "DS:standby:GAUGE:600:0:1", "RRA:AVERAGE:0.5:1:576", "RRA:AVERAGE:0.5:6:672", @@ -62,13 +61,13 @@ sub updatehdddata if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;} else {$standby = 0;} - RRDs::update ("$rrdlog/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby"); + RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby"); $ERROR = RRDs::error; print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR; - if ( ! -e "$rrdlog/hddtemp-".$array[$#array].".rrd"){ + if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){ # database did not exist -> create - RRDs::create ("$rrdlog/hddtemp-".$array[$#array].".rrd", "--step=300", + RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300", "DS:temperature:GAUGE:600:0:100", "RRA:AVERAGE:0.5:1:576", "RRA:AVERAGE:0.5:6:672", @@ -91,7 +90,7 @@ sub updatehdddata print "Temperature for ".$array[$#array]."->".$temp."<-\n"; # Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht) if ($temp){ - RRDs::update ("$rrdlog/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp"); + RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp"); $ERROR = RRDs::error; print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR; }