Advertisement
Guest User

rrdtool

a guest
Dec 11th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.80 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use RRDs;
  4.  
  5. #my $cur_time = time();
  6. #my $start_time = $cur_time - 86400;     # set end time to 24 hours ago
  7.  
  8. RRDs::graph "/var/www/temperatur/graph_all.png",
  9.                         "--start= -24h",
  10.                         "--end= now",
  11.                         "--title= Snarhemsvägen, Last 24 hours",
  12.                         "--height= 300",
  13.                         "--width= 500",
  14.                         "--vertical-label= °C",
  15.               "DEF:KontoretTemp=/home/look2/rrddata/kontor.rrd:kontortemp:AVERAGE",
  16.               "DEF:OutsideTemp=/home/look2/rrddata/outside_temp.rrd:outsidetemp:AVERAGE",
  17.               "DEF:GastrumTemp=/home/look2/rrddata/gastrum.rrd:gastrumtemp:AVERAGE",
  18.                         "COMMENT:\t\t\t\t\tNu     Medel    Max    Min",
  19.                         "HRULE:0#0000FF",
  20.               "LINE2:KontoretTemp#0000FF:Kontoret1\t\t\t",
  21.                         "GPRINT:KontoretTemp:LAST:%6.1lf ",
  22.                         "GPRINT:KontoretTemp:AVERAGE:%6.1l f",
  23.                         "GPRINT:KontoretTemp:MAX:%6.1l f",
  24.                         "GPRINT:KontoretTemp:MIN:%6.1lf\\n",
  25.               "LINE2:OutsideTemp#FF0000:Utomhus\t\t\t",
  26.                         "GPRINT:OutsideTemp:LAST:%6.1lf ",
  27.                         "GPRINT:OutsideTemp:AVERAGE:%6.1lf ",
  28.                         "GPRINT:OutsideTemp:MAX:%6.1lf ",
  29.                         "GPRINT:OutsideTemp:MIN:%6.1lf\\l ";
  30.               "LINE2:GastrumTemp#FFCC00:Gastrum\t\t\t",
  31.                         "GPRINT:GastrumTemp:LAST:%6.1lf ",
  32.                         "GPRINT:GastrumTemp:AVERAGE:%6.1lf ",
  33.                         "GPRINT:GastrumTemp:MAX:%6.1lf ",
  34.                         "GPRINT:GastrumTemp:MIN:%6.1lf\\l ";
  35. my $err=RRDs::error;
  36. if ($err) {print "problem generating the graph: $err\n";}
  37.  
  38. print "Done!\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement