Changed makegraphs to rrdlog

This commit is contained in:
Maniacikarus
2008-09-28 14:19:43 +02:00
parent 7d0027bc10
commit 42ae148e5c

View 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;
}