HRDLE在RRDTOOL的MIN值

时间:2016-06-08 19:27:43

标签: perl rrdtool

我试图在我的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:\t\t\t\t     Nu      Medel    Max     Min\\n",
            "HRULE:0#003300",
            "LINE1:Temperatur#ff0000:ute\t\t\t\t",
            "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: $err\n";}

print "klar!\n"

1 个答案:

答案 0 :(得分:0)

您可以使用

VDEF:m=Temperatur,MINIMUM
LINE1:m#003300