Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use RRDs;
- #my $cur_time = time();
- #my $start_time = $cur_time - 86400; # set end time to 24 hours ago
- RRDs::graph "/var/www/temperatur/graph_all.png",
- "--start= -24h",
- "--end= now",
- "--title= Snarhemsvägen, Last 24 hours",
- "--height= 300",
- "--width= 500",
- "--vertical-label= °C",
- "DEF:KontoretTemp=/home/look2/rrddata/kontor.rrd:kontortemp:AVERAGE",
- "DEF:OutsideTemp=/home/look2/rrddata/outside_temp.rrd:outsidetemp:AVERAGE",
- "DEF:GastrumTemp=/home/look2/rrddata/gastrum.rrd:gastrumtemp:AVERAGE",
- "COMMENT:\t\t\t\t\tNu Medel Max Min",
- "HRULE:0#0000FF",
- "LINE2:KontoretTemp#0000FF:Kontoret1\t\t\t",
- "GPRINT:KontoretTemp:LAST:%6.1lf ",
- "GPRINT:KontoretTemp:AVERAGE:%6.1l f",
- "GPRINT:KontoretTemp:MAX:%6.1l f",
- "GPRINT:KontoretTemp:MIN:%6.1lf\\n",
- "LINE2:OutsideTemp#FF0000:Utomhus\t\t\t",
- "GPRINT:OutsideTemp:LAST:%6.1lf ",
- "GPRINT:OutsideTemp:AVERAGE:%6.1lf ",
- "GPRINT:OutsideTemp:MAX:%6.1lf ",
- "GPRINT:OutsideTemp:MIN:%6.1lf\\l ";
- "LINE2:GastrumTemp#FFCC00:Gastrum\t\t\t",
- "GPRINT:GastrumTemp:LAST:%6.1lf ",
- "GPRINT:GastrumTemp:AVERAGE:%6.1lf ",
- "GPRINT:GastrumTemp:MAX:%6.1lf ",
- "GPRINT:GastrumTemp:MIN:%6.1lf\\l ";
- my $err=RRDs::error;
- if ($err) {print "problem generating the graph: $err\n";}
- print "Done!\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement