我正在尝试在我的RRD-GRAPH中获取最低值的水平线(HRULE),而没有任何好的结果:(
我在数据库中只有一个数据源,结束脚本用 PEARL 编码
#!/usr/bin/perl
use RRDs;
my $cur_time = time();
my $start_time = $cur_time - 86400; # sätt start ill 24 timmar sedan
my $end_1 = time() - 86400;
my $start_1 = $end_1 - 86400;
RRDs::graph "/var/www/ute.png",
"--start= $start_time",
"--end= $cur_time",
"--title= outdoor temperature 1-WIRE 24h",
"--height= 600",
"--width= 1000",
"--vertical-label= °C",
"--upper-limit= 30",
"--lower-limit= -30",
"DEF:Temperatur=/home/nordviken/rrddata/ute_temp.rrd:ute:AVERAGE",
"CDEF:a=Temperatur,-50,0,LIMIT",
"DEF:b=/home/nordviken/rrddata/ute_temp.rrd:ute:AVERAGE:end= $end_1:start= $start_1",
"SHIFT:b:86400",
"COMMENT:tttt Nu Medel Max Min\n",
"HRULE:0#003300",
"LINE1:Temperatur#ff0000:utetttt",
"LINE1:a#0000ff",
"LINE1:b#00ff00",
"GPRINT:Temperatur:LAST:%6.1lf",
"GPRINT:Temperatur:AVERAGE:%6.1lf",
"GPRINT:Temperatur:MAX:%6.1lf",
"GPRINT:Temperatur:MIN:%6.1lf\n";
my $err=RRDs::error;
if ($err) {print "problem med att skapa grafen: $errn";}
print "klar!n"
您可以使用
VDEF:m=Temperatur,MINIMUM
LINE1:m#003300