]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Changed makegraphs to rrdlog
authorManiacikarus <maniacikarus@ipfire.org>
Sun, 28 Sep 2008 12:19:43 +0000 (14:19 +0200)
committerManiacikarus <maniacikarus@ipfire.org>
Sun, 28 Sep 2008 12:19:43 +0000 (14:19 +0200)
src/scripts/makegraphs

index cfe5f8fa39985926efea8294d322c82cce0f8728..72bf77dbad9b3d26f6232e47c49e83ff3340811c 100644 (file)
@@ -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;
                 }