Инструменты пользователя

Инструменты сайта


bananapi:rrdtool

Banana PI + rrdtool

apt-get install libwww-perl
apt-get install rrdtool
apt-get install php5-cli
apt-get install php5-cgi

Создаю базу для хранения данных о температуре.

rrdtool create 00044e42dfff.rrd --start N --step 300 \
DS:therm:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:6:336 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:144:730

Скрипрт для занесения данных о температуре в базу.

cat therm.php
#!/usr/bin/php
<?php
$teilen = '1000';

// 28-00044e42dfff
$temp01 = exec('cat /sys/bus/w1/devices/28-00044e42dfff/w1_slave |grep t=');
$temp01 = explode('t=',$temp01);
$temp01 = $temp01[1] / 1000;
$temp01 = round($temp01,2);
// print $temp01 . PHP_EOL;
exec("/usr/bin/rrdtool update /var/db/rrdtool/00044e42dfff.rrd N:$temp01");
?>

Проверяю скрипт на ошибки

/usr/bin/php -l therm.php
No syntax errors detected in therm.php

Поместил в crontab строку для выполнения скрипта каждые 5 минут.

  • /5 * * * * root /usr/bin/php -q /scripts/therm.php > /dev/null 2>&1

В /var/www создаю папку therm в ней с помощью rrdcgi я создам странику для отображения температуры.

www/therm # cat index.cgi
#!/usr/bin/rrdcgi
 
<HTML>
<HEAD>
  <CONTENT="text/html; charset=UTF-8">
   <META HTTP-EQUIV=refresh content='300'>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
   <meta name="description" content="Онлайн температура в Георгиевске, Ставропольский край, температурные графики" />
   <meta name="keywords" content="Онлайн, Online, термометр, termometr, температура, график" />
  <TITLE>Температура воздуха в г.Георгиевск</TITLE>
</HEAD>
<BODY>
<CENTER>
<H2>Температура воздуха в г.Георгиевск</H2>
 
<RRD::GRAPH /var/www/therm/png/day.png --lazy --rigid --slope-mode --width 500 --heigh 200
--title "Температура за сутки" --start -1d --font TITLE:13 --color BACK#164A4A
--color SHADEA#444444 --color SHADEB#444444 --color CANVAS#2E7778
--color FONT#ff7518 --slope-mode --imginfo
'<IMG SRC=png/%s WIDTH=%lu HEIGHT=%lu>'
DEF:therm=/var/db/rrdtool/00044e42dfff.rrd:therm:AVERAGE
CDEF:tp_34=therm,0,GT,therm,100,GT,34,therm,IF,0,IF AREA:tp_34#FF0000
CDEF:tp_33=therm,0,GT,therm,33,GT,33,therm,IF,0,IF AREA:tp_34#FF0F00
CDEF:tp_32=therm,0,GT,therm,32,GT,32,therm,IF,0,IF AREA:tp_32#FF1700
CDEF:tp_31=therm,0,GT,therm,31,GT,31,therm,IF,0,IF AREA:tp_31#FF1F00
CDEF:tp_30=therm,0,GT,therm,30,GT,30,therm,IF,0,IF AREA:tp_30#FF2700
CDEF:tp_29=therm,0,GT,therm,29,GT,29,therm,IF,0,IF AREA:tp_29#FF2F00
CDEF:tp_28=therm,0,GT,therm,28,GT,28,therm,IF,0,IF AREA:tp_28#FF3700
CDEF:tp_27=therm,0,GT,therm,27,GT,27,therm,IF,0,IF AREA:tp_27#FF3F00
CDEF:tp_26=therm,0,GT,therm,26,GT,26,therm,IF,0,IF AREA:tp_26#FF4700
CDEF:tp_25=therm,0,GT,therm,25,GT,25,therm,IF,0,IF AREA:tp_25#FF4F00
CDEF:tp_24=therm,0,GT,therm,24,GT,24,therm,IF,0,IF AREA:tp_24#FF5700
CDEF:tp_23=therm,0,GT,therm,23,GT,23,therm,IF,0,IF AREA:tp_23#FF5F00
CDEF:tp_22=therm,0,GT,therm,22,GT,22,therm,IF,0,IF AREA:tp_22#FF6700
CDEF:tp_21=therm,0,GT,therm,21,GT,21,therm,IF,0,IF AREA:tp_21#FF6F00
CDEF:tp_20=therm,0,GT,therm,20,GT,20,therm,IF,0,IF AREA:tp_20#FF7700
CDEF:tp_19=therm,0,GT,therm,19,GT,19,therm,IF,0,IF AREA:tp_19#FF7F00
CDEF:tp_18=therm,0,GT,therm,18,GT,18,therm,IF,0,IF AREA:tp_18#FF8700
CDEF:tp_17=therm,0,GT,therm,17,GT,17,therm,IF,0,IF AREA:tp_17#FF8F00
CDEF:tp_16=therm,0,GT,therm,16,GT,16,therm,IF,0,IF AREA:tp_16#FF9700
CDEF:tp_15=therm,0,GT,therm,15,GT,15,therm,IF,0,IF AREA:tp_15#FF9F00
CDEF:tp_14=therm,0,GT,therm,14,GT,14,therm,IF,0,IF AREA:tp_14#FFA700
CDEF:tp_13=therm,0,GT,therm,13,GT,13,therm,IF,0,IF AREA:tp_13#FFAF00
CDEF:tp_12=therm,0,GT,therm,12,GT,12,therm,IF,0,IF AREA:tp_12#FFB700
CDEF:tp_11=therm,0,GT,therm,11,GT,11,therm,IF,0,IF AREA:tp_11#FFBF00
CDEF:tp_10=therm,0,GT,therm,10,GT,10,therm,IF,0,IF AREA:tp_10#FFC700
CDEF:tp_09=therm,0,GT,therm,09,GT,09,therm,IF,0,IF AREA:tp_09#FFCF00
CDEF:tp_08=therm,0,GT,therm,8,GT,8,therm,IF,0,IF  AREA:tp_08#FFD700
CDEF:tp_07=therm,0,GT,therm,7,GT,7,therm,IF,0,IF  AREA:tp_07#FFDF00
CDEF:tp_06=therm,0,GT,therm,6,GT,6,therm,IF,0,IF  AREA:tp_06#FFE700
CDEF:tp_05=therm,0,GT,therm,5,GT,5,therm,IF,0,IF  AREA:tp_05#FFEF00
CDEF:tp_04=therm,0,GT,therm,4,GT,4,therm,IF,0,IF  AREA:tp_04#FFF700
CDEF:tp_03=therm,0,GT,therm,3,GT,3,therm,IF,0,IF  AREA:tp_03#FFFF00
CDEF:tp_02=therm,0,GT,therm,2,GT,2,therm,IF,0,IF  AREA:tp_02#ffff6F
CDEF:tp_01=therm,0,GT,therm,1,GT,1,therm,IF,0,IF  AREA:tp_01#ffffAF
 
CDEF:tm_17=therm,0,LT,therm,-100,LT,-34,therm,IF,0,IF AREA:tm_17#0000FF
CDEF:tm_16=therm,0,LT,therm,-32,LT,-32,therm,IF,0,IF AREA:tm_16#0011FF
CDEF:tm_15=therm,0,LT,therm,-30,LT,-30,therm,IF,0,IF AREA:tm_15#0022FF
CDEF:tm_14=therm,0,LT,therm,-28,LT,-28,therm,IF,0,IF AREA:tm_14#0033FF
CDEF:tm_13=therm,0,LT,therm,-26,LT,-26,therm,IF,0,IF AREA:tm_13#0044FF
CDEF:tm_12=therm,0,LT,therm,-24,LT,-24,therm,IF,0,IF AREA:tm_12#0055FF
CDEF:tm_11=therm,0,LT,therm,-22,LT,-22,therm,IF,0,IF AREA:tm_11#0066FF
CDEF:tm_10=therm,0,LT,therm,-20,LT,-20,therm,IF,0,IF AREA:tm_10#0077FF
CDEF:tm_09=therm,0,LT,therm,-18,LT,-18,therm,IF,0,IF AREA:tm_09#0088FF
CDEF:tm_08=therm,0,LT,therm,-16,LT,-16,therm,IF,0,IF AREA:tm_08#0099FF
CDEF:tm_07=therm,0,LT,therm,-14,LT,-14,therm,IF,0,IF AREA:tm_07#00AAFF
CDEF:tm_06=therm,0,LT,therm,-12,LT,-12,therm,IF,0,IF AREA:tm_06#00BBFF
CDEF:tm_05=therm,0,LT,therm,-10,LT,-10,therm,IF,0,IF AREA:tm_05#00CCFF
CDEF:tm_04=therm,0,LT,therm,-8,LT,-8,therm,IF,0,IF AREA:tm_04#00DDFF
CDEF:tm_03=therm,0,LT,therm,-6,LT,-6,therm,IF,0,IF AREA:tm_03#00EEFF
CDEF:tm_02=therm,0,LT,therm,-4,LT,-4,therm,IF,0,IF AREA:tm_02#00FFFF
CDEF:tm_01=therm,0,LT,therm,-2,LT,-2,therm,IF,0,IF AREA:tm_01#CDFFFF
 
LINE1:therm:""  "GPRINT:therm:LAST:Сейчас\:%3.2lfC" "GPRINT:therm:MAX:Максимальная\:%3.2lfC" "GPRINT:therm:MIN:Минимальная\:%3.2lfC">
<br>
<br>
<RRD::GRAPH /var/www/therm/png/week.png --lazy --rigid --slope-mode --width 500 --heigh 200
--title "Температура за неделю" --start -1w --font TITLE:13 --color BACK#164A4A
--color SHADEA#444444 --color SHADEB#444444 --color CANVAS#2E7778
--color FONT#ff7518 --slope-mode --imginfo
'<IMG SRC=png/%s WIDTH=%lu HEIGHT=%lu>'
DEF:therm=/var/db/rrdtool/00044e42dfff.rrd:therm:AVERAGE
CDEF:tp_34=therm,0,GT,therm,100,GT,34,therm,IF,0,IF AREA:tp_34#FF0000
CDEF:tp_33=therm,0,GT,therm,33,GT,33,therm,IF,0,IF AREA:tp_34#FF0F00
CDEF:tp_32=therm,0,GT,therm,32,GT,32,therm,IF,0,IF AREA:tp_32#FF1700
CDEF:tp_31=therm,0,GT,therm,31,GT,31,therm,IF,0,IF AREA:tp_31#FF1F00
CDEF:tp_30=therm,0,GT,therm,30,GT,30,therm,IF,0,IF AREA:tp_30#FF2700
CDEF:tp_29=therm,0,GT,therm,29,GT,29,therm,IF,0,IF AREA:tp_29#FF2F00
CDEF:tp_28=therm,0,GT,therm,28,GT,28,therm,IF,0,IF AREA:tp_28#FF3700
CDEF:tp_27=therm,0,GT,therm,27,GT,27,therm,IF,0,IF AREA:tp_27#FF3F00
CDEF:tp_26=therm,0,GT,therm,26,GT,26,therm,IF,0,IF AREA:tp_26#FF4700
CDEF:tp_25=therm,0,GT,therm,25,GT,25,therm,IF,0,IF AREA:tp_25#FF4F00
CDEF:tp_24=therm,0,GT,therm,24,GT,24,therm,IF,0,IF AREA:tp_24#FF5700
CDEF:tp_23=therm,0,GT,therm,23,GT,23,therm,IF,0,IF AREA:tp_23#FF5F00
CDEF:tp_22=therm,0,GT,therm,22,GT,22,therm,IF,0,IF AREA:tp_22#FF6700
CDEF:tp_21=therm,0,GT,therm,21,GT,21,therm,IF,0,IF AREA:tp_21#FF6F00
CDEF:tp_20=therm,0,GT,therm,20,GT,20,therm,IF,0,IF AREA:tp_20#FF7700
CDEF:tp_19=therm,0,GT,therm,19,GT,19,therm,IF,0,IF AREA:tp_19#FF7F00
CDEF:tp_18=therm,0,GT,therm,18,GT,18,therm,IF,0,IF AREA:tp_18#FF8700
CDEF:tp_17=therm,0,GT,therm,17,GT,17,therm,IF,0,IF AREA:tp_17#FF8F00
CDEF:tp_16=therm,0,GT,therm,16,GT,16,therm,IF,0,IF AREA:tp_16#FF9700
CDEF:tp_15=therm,0,GT,therm,15,GT,15,therm,IF,0,IF AREA:tp_15#FF9F00
CDEF:tp_14=therm,0,GT,therm,14,GT,14,therm,IF,0,IF AREA:tp_14#FFA700
CDEF:tp_13=therm,0,GT,therm,13,GT,13,therm,IF,0,IF AREA:tp_13#FFAF00
CDEF:tp_12=therm,0,GT,therm,12,GT,12,therm,IF,0,IF AREA:tp_12#FFB700
CDEF:tp_11=therm,0,GT,therm,11,GT,11,therm,IF,0,IF AREA:tp_11#FFBF00
CDEF:tp_10=therm,0,GT,therm,10,GT,10,therm,IF,0,IF AREA:tp_10#FFC700
CDEF:tp_09=therm,0,GT,therm,09,GT,09,therm,IF,0,IF AREA:tp_09#FFCF00
CDEF:tp_08=therm,0,GT,therm,8,GT,8,therm,IF,0,IF  AREA:tp_08#FFD700
CDEF:tp_07=therm,0,GT,therm,7,GT,7,therm,IF,0,IF  AREA:tp_07#FFDF00
CDEF:tp_06=therm,0,GT,therm,6,GT,6,therm,IF,0,IF  AREA:tp_06#FFE700
CDEF:tp_05=therm,0,GT,therm,5,GT,5,therm,IF,0,IF  AREA:tp_05#FFEF00
CDEF:tp_04=therm,0,GT,therm,4,GT,4,therm,IF,0,IF  AREA:tp_04#FFF700
CDEF:tp_03=therm,0,GT,therm,3,GT,3,therm,IF,0,IF  AREA:tp_03#FFFF00
CDEF:tp_02=therm,0,GT,therm,2,GT,2,therm,IF,0,IF  AREA:tp_02#ffff6F
CDEF:tp_01=therm,0,GT,therm,1,GT,1,therm,IF,0,IF  AREA:tp_01#ffffAF
 
CDEF:tm_17=therm,0,LT,therm,-100,LT,-34,therm,IF,0,IF AREA:tm_17#0000FF
CDEF:tm_16=therm,0,LT,therm,-32,LT,-32,therm,IF,0,IF AREA:tm_16#0011FF
CDEF:tm_15=therm,0,LT,therm,-30,LT,-30,therm,IF,0,IF AREA:tm_15#0022FF
CDEF:tm_14=therm,0,LT,therm,-28,LT,-28,therm,IF,0,IF AREA:tm_14#0033FF
CDEF:tm_13=therm,0,LT,therm,-26,LT,-26,therm,IF,0,IF AREA:tm_13#0044FF
CDEF:tm_12=therm,0,LT,therm,-24,LT,-24,therm,IF,0,IF AREA:tm_12#0055FF
CDEF:tm_11=therm,0,LT,therm,-22,LT,-22,therm,IF,0,IF AREA:tm_11#0066FF
CDEF:tm_10=therm,0,LT,therm,-20,LT,-20,therm,IF,0,IF AREA:tm_10#0077FF
CDEF:tm_09=therm,0,LT,therm,-18,LT,-18,therm,IF,0,IF AREA:tm_09#0088FF
CDEF:tm_08=therm,0,LT,therm,-16,LT,-16,therm,IF,0,IF AREA:tm_08#0099FF
CDEF:tm_07=therm,0,LT,therm,-14,LT,-14,therm,IF,0,IF AREA:tm_07#00AAFF
CDEF:tm_06=therm,0,LT,therm,-12,LT,-12,therm,IF,0,IF AREA:tm_06#00BBFF
CDEF:tm_05=therm,0,LT,therm,-10,LT,-10,therm,IF,0,IF AREA:tm_05#00CCFF
CDEF:tm_04=therm,0,LT,therm,-8,LT,-8,therm,IF,0,IF AREA:tm_04#00DDFF
CDEF:tm_03=therm,0,LT,therm,-6,LT,-6,therm,IF,0,IF AREA:tm_03#00EEFF
CDEF:tm_02=therm,0,LT,therm,-4,LT,-4,therm,IF,0,IF AREA:tm_02#00FFFF
CDEF:tm_01=therm,0,LT,therm,-2,LT,-2,therm,IF,0,IF AREA:tm_01#CDFFFF
 
LINE1:therm:""  "GPRINT:therm:LAST:Сейчас\:%3.2lfC" "GPRINT:therm:MAX:Максимальная\:%3.2lfC" "GPRINT:therm:MIN:Минимальная\:%3.2lfC">
<br>
<br>
<RRD::GRAPH /var/www/therm/png/month.png --lazy --rigid --slope-mode --width 500 --heigh 200
--title "Температура за месяц" --start -1m --font TITLE:13 --color BACK#164A4A
--color SHADEA#444444 --color SHADEB#444444 --color CANVAS#2E7778
--color FONT#ff7518 --slope-mode --imginfo
'<IMG SRC=png/%s WIDTH=%lu HEIGHT=%lu>'
DEF:therm=/var/db/rrdtool/00044e42dfff.rrd:therm:AVERAGE
CDEF:tp_34=therm,0,GT,therm,100,GT,34,therm,IF,0,IF AREA:tp_34#FF0000
CDEF:tp_33=therm,0,GT,therm,33,GT,33,therm,IF,0,IF AREA:tp_34#FF0F00
CDEF:tp_32=therm,0,GT,therm,32,GT,32,therm,IF,0,IF AREA:tp_32#FF1700
CDEF:tp_31=therm,0,GT,therm,31,GT,31,therm,IF,0,IF AREA:tp_31#FF1F00
CDEF:tp_30=therm,0,GT,therm,30,GT,30,therm,IF,0,IF AREA:tp_30#FF2700
CDEF:tp_29=therm,0,GT,therm,29,GT,29,therm,IF,0,IF AREA:tp_29#FF2F00
CDEF:tp_28=therm,0,GT,therm,28,GT,28,therm,IF,0,IF AREA:tp_28#FF3700
CDEF:tp_27=therm,0,GT,therm,27,GT,27,therm,IF,0,IF AREA:tp_27#FF3F00
CDEF:tp_26=therm,0,GT,therm,26,GT,26,therm,IF,0,IF AREA:tp_26#FF4700
CDEF:tp_25=therm,0,GT,therm,25,GT,25,therm,IF,0,IF AREA:tp_25#FF4F00
CDEF:tp_24=therm,0,GT,therm,24,GT,24,therm,IF,0,IF AREA:tp_24#FF5700
CDEF:tp_23=therm,0,GT,therm,23,GT,23,therm,IF,0,IF AREA:tp_23#FF5F00
CDEF:tp_22=therm,0,GT,therm,22,GT,22,therm,IF,0,IF AREA:tp_22#FF6700
CDEF:tp_21=therm,0,GT,therm,21,GT,21,therm,IF,0,IF AREA:tp_21#FF6F00
CDEF:tp_20=therm,0,GT,therm,20,GT,20,therm,IF,0,IF AREA:tp_20#FF7700
CDEF:tp_19=therm,0,GT,therm,19,GT,19,therm,IF,0,IF AREA:tp_19#FF7F00
CDEF:tp_18=therm,0,GT,therm,18,GT,18,therm,IF,0,IF AREA:tp_18#FF8700
CDEF:tp_17=therm,0,GT,therm,17,GT,17,therm,IF,0,IF AREA:tp_17#FF8F00
CDEF:tp_16=therm,0,GT,therm,16,GT,16,therm,IF,0,IF AREA:tp_16#FF9700
CDEF:tp_15=therm,0,GT,therm,15,GT,15,therm,IF,0,IF AREA:tp_15#FF9F00
CDEF:tp_14=therm,0,GT,therm,14,GT,14,therm,IF,0,IF AREA:tp_14#FFA700
CDEF:tp_13=therm,0,GT,therm,13,GT,13,therm,IF,0,IF AREA:tp_13#FFAF00
CDEF:tp_12=therm,0,GT,therm,12,GT,12,therm,IF,0,IF AREA:tp_12#FFB700
CDEF:tp_11=therm,0,GT,therm,11,GT,11,therm,IF,0,IF AREA:tp_11#FFBF00
CDEF:tp_10=therm,0,GT,therm,10,GT,10,therm,IF,0,IF AREA:tp_10#FFC700
CDEF:tp_09=therm,0,GT,therm,09,GT,09,therm,IF,0,IF AREA:tp_09#FFCF00
CDEF:tp_08=therm,0,GT,therm,8,GT,8,therm,IF,0,IF  AREA:tp_08#FFD700
CDEF:tp_07=therm,0,GT,therm,7,GT,7,therm,IF,0,IF  AREA:tp_07#FFDF00
CDEF:tp_06=therm,0,GT,therm,6,GT,6,therm,IF,0,IF  AREA:tp_06#FFE700
CDEF:tp_05=therm,0,GT,therm,5,GT,5,therm,IF,0,IF  AREA:tp_05#FFEF00
CDEF:tp_04=therm,0,GT,therm,4,GT,4,therm,IF,0,IF  AREA:tp_04#FFF700
CDEF:tp_03=therm,0,GT,therm,3,GT,3,therm,IF,0,IF  AREA:tp_03#FFFF00
CDEF:tp_02=therm,0,GT,therm,2,GT,2,therm,IF,0,IF  AREA:tp_02#ffff6F
CDEF:tp_01=therm,0,GT,therm,1,GT,1,therm,IF,0,IF  AREA:tp_01#ffffAF
 
CDEF:tm_17=therm,0,LT,therm,-100,LT,-34,therm,IF,0,IF AREA:tm_17#0000FF
CDEF:tm_16=therm,0,LT,therm,-32,LT,-32,therm,IF,0,IF AREA:tm_16#0011FF
CDEF:tm_15=therm,0,LT,therm,-30,LT,-30,therm,IF,0,IF AREA:tm_15#0022FF
CDEF:tm_14=therm,0,LT,therm,-28,LT,-28,therm,IF,0,IF AREA:tm_14#0033FF
CDEF:tm_13=therm,0,LT,therm,-26,LT,-26,therm,IF,0,IF AREA:tm_13#0044FF
CDEF:tm_12=therm,0,LT,therm,-24,LT,-24,therm,IF,0,IF AREA:tm_12#0055FF
CDEF:tm_11=therm,0,LT,therm,-22,LT,-22,therm,IF,0,IF AREA:tm_11#0066FF
CDEF:tm_10=therm,0,LT,therm,-20,LT,-20,therm,IF,0,IF AREA:tm_10#0077FF
CDEF:tm_09=therm,0,LT,therm,-18,LT,-18,therm,IF,0,IF AREA:tm_09#0088FF
CDEF:tm_08=therm,0,LT,therm,-16,LT,-16,therm,IF,0,IF AREA:tm_08#0099FF
CDEF:tm_07=therm,0,LT,therm,-14,LT,-14,therm,IF,0,IF AREA:tm_07#00AAFF
CDEF:tm_06=therm,0,LT,therm,-12,LT,-12,therm,IF,0,IF AREA:tm_06#00BBFF
CDEF:tm_05=therm,0,LT,therm,-10,LT,-10,therm,IF,0,IF AREA:tm_05#00CCFF
CDEF:tm_04=therm,0,LT,therm,-8,LT,-8,therm,IF,0,IF AREA:tm_04#00DDFF
CDEF:tm_03=therm,0,LT,therm,-6,LT,-6,therm,IF,0,IF AREA:tm_03#00EEFF
CDEF:tm_02=therm,0,LT,therm,-4,LT,-4,therm,IF,0,IF AREA:tm_02#00FFFF
CDEF:tm_01=therm,0,LT,therm,-2,LT,-2,therm,IF,0,IF AREA:tm_01#CDFFFF
 
LINE1:therm:""  "GPRINT:therm:LAST:Сейчас\:%3.2lfC" "GPRINT:therm:MAX:Максимальная\:%3.2lfC" "GPRINT:therm:MIN:Минимальная\:%3.2lfC">
<br>
<br>
<RRD::GRAPH /var/www/therm/png/year.png --lazy --rigid --slope-mode --width 500 --heigh 200
--title "Температура за год" --start -1y --font TITLE:13 --color BACK#164A4A
--color SHADEA#444444 --color SHADEB#444444 --color CANVAS#2E7778
--color FONT#ff7518 --slope-mode --imginfo
'<IMG SRC=png/%s WIDTH=%lu HEIGHT=%lu>'
DEF:therm=/var/db/rrdtool/00044e42dfff.rrd:therm:AVERAGE
CDEF:tp_34=therm,0,GT,therm,100,GT,34,therm,IF,0,IF AREA:tp_34#FF0000
CDEF:tp_33=therm,0,GT,therm,33,GT,33,therm,IF,0,IF AREA:tp_34#FF0F00
CDEF:tp_32=therm,0,GT,therm,32,GT,32,therm,IF,0,IF AREA:tp_32#FF1700
CDEF:tp_31=therm,0,GT,therm,31,GT,31,therm,IF,0,IF AREA:tp_31#FF1F00
CDEF:tp_30=therm,0,GT,therm,30,GT,30,therm,IF,0,IF AREA:tp_30#FF2700
CDEF:tp_29=therm,0,GT,therm,29,GT,29,therm,IF,0,IF AREA:tp_29#FF2F00
CDEF:tp_28=therm,0,GT,therm,28,GT,28,therm,IF,0,IF AREA:tp_28#FF3700
CDEF:tp_27=therm,0,GT,therm,27,GT,27,therm,IF,0,IF AREA:tp_27#FF3F00
CDEF:tp_26=therm,0,GT,therm,26,GT,26,therm,IF,0,IF AREA:tp_26#FF4700
CDEF:tp_25=therm,0,GT,therm,25,GT,25,therm,IF,0,IF AREA:tp_25#FF4F00
CDEF:tp_24=therm,0,GT,therm,24,GT,24,therm,IF,0,IF AREA:tp_24#FF5700
CDEF:tp_23=therm,0,GT,therm,23,GT,23,therm,IF,0,IF AREA:tp_23#FF5F00
CDEF:tp_22=therm,0,GT,therm,22,GT,22,therm,IF,0,IF AREA:tp_22#FF6700
CDEF:tp_21=therm,0,GT,therm,21,GT,21,therm,IF,0,IF AREA:tp_21#FF6F00
CDEF:tp_20=therm,0,GT,therm,20,GT,20,therm,IF,0,IF AREA:tp_20#FF7700
CDEF:tp_19=therm,0,GT,therm,19,GT,19,therm,IF,0,IF AREA:tp_19#FF7F00
CDEF:tp_18=therm,0,GT,therm,18,GT,18,therm,IF,0,IF AREA:tp_18#FF8700
CDEF:tp_17=therm,0,GT,therm,17,GT,17,therm,IF,0,IF AREA:tp_17#FF8F00
CDEF:tp_16=therm,0,GT,therm,16,GT,16,therm,IF,0,IF AREA:tp_16#FF9700
CDEF:tp_15=therm,0,GT,therm,15,GT,15,therm,IF,0,IF AREA:tp_15#FF9F00
CDEF:tp_14=therm,0,GT,therm,14,GT,14,therm,IF,0,IF AREA:tp_14#FFA700
CDEF:tp_13=therm,0,GT,therm,13,GT,13,therm,IF,0,IF AREA:tp_13#FFAF00
CDEF:tp_12=therm,0,GT,therm,12,GT,12,therm,IF,0,IF AREA:tp_12#FFB700
CDEF:tp_11=therm,0,GT,therm,11,GT,11,therm,IF,0,IF AREA:tp_11#FFBF00
CDEF:tp_10=therm,0,GT,therm,10,GT,10,therm,IF,0,IF AREA:tp_10#FFC700
CDEF:tp_09=therm,0,GT,therm,09,GT,09,therm,IF,0,IF AREA:tp_09#FFCF00
CDEF:tp_08=therm,0,GT,therm,8,GT,8,therm,IF,0,IF  AREA:tp_08#FFD700
CDEF:tp_07=therm,0,GT,therm,7,GT,7,therm,IF,0,IF  AREA:tp_07#FFDF00
CDEF:tp_06=therm,0,GT,therm,6,GT,6,therm,IF,0,IF  AREA:tp_06#FFE700
CDEF:tp_05=therm,0,GT,therm,5,GT,5,therm,IF,0,IF  AREA:tp_05#FFEF00
CDEF:tp_04=therm,0,GT,therm,4,GT,4,therm,IF,0,IF  AREA:tp_04#FFF700
CDEF:tp_03=therm,0,GT,therm,3,GT,3,therm,IF,0,IF  AREA:tp_03#FFFF00
CDEF:tp_02=therm,0,GT,therm,2,GT,2,therm,IF,0,IF  AREA:tp_02#ffff6F
CDEF:tp_01=therm,0,GT,therm,1,GT,1,therm,IF,0,IF  AREA:tp_01#ffffAF
 
CDEF:tm_17=therm,0,LT,therm,-100,LT,-34,therm,IF,0,IF AREA:tm_17#0000FF
CDEF:tm_16=therm,0,LT,therm,-32,LT,-32,therm,IF,0,IF AREA:tm_16#0011FF
CDEF:tm_15=therm,0,LT,therm,-30,LT,-30,therm,IF,0,IF AREA:tm_15#0022FF
CDEF:tm_14=therm,0,LT,therm,-28,LT,-28,therm,IF,0,IF AREA:tm_14#0033FF
CDEF:tm_13=therm,0,LT,therm,-26,LT,-26,therm,IF,0,IF AREA:tm_13#0044FF
CDEF:tm_12=therm,0,LT,therm,-24,LT,-24,therm,IF,0,IF AREA:tm_12#0055FF
CDEF:tm_11=therm,0,LT,therm,-22,LT,-22,therm,IF,0,IF AREA:tm_11#0066FF
CDEF:tm_10=therm,0,LT,therm,-20,LT,-20,therm,IF,0,IF AREA:tm_10#0077FF
CDEF:tm_09=therm,0,LT,therm,-18,LT,-18,therm,IF,0,IF AREA:tm_09#0088FF
CDEF:tm_08=therm,0,LT,therm,-16,LT,-16,therm,IF,0,IF AREA:tm_08#0099FF
CDEF:tm_07=therm,0,LT,therm,-14,LT,-14,therm,IF,0,IF AREA:tm_07#00AAFF
CDEF:tm_06=therm,0,LT,therm,-12,LT,-12,therm,IF,0,IF AREA:tm_06#00BBFF
CDEF:tm_05=therm,0,LT,therm,-10,LT,-10,therm,IF,0,IF AREA:tm_05#00CCFF
CDEF:tm_04=therm,0,LT,therm,-8,LT,-8,therm,IF,0,IF AREA:tm_04#00DDFF
CDEF:tm_03=therm,0,LT,therm,-6,LT,-6,therm,IF,0,IF AREA:tm_03#00EEFF
CDEF:tm_02=therm,0,LT,therm,-4,LT,-4,therm,IF,0,IF AREA:tm_02#00FFFF
CDEF:tm_01=therm,0,LT,therm,-2,LT,-2,therm,IF,0,IF AREA:tm_01#CDFFFF
 
LINE1:therm:""  "GPRINT:therm:LAST:Сейчас\:%3.2lfC" "GPRINT:therm:MAX:Максимальная\:%3.2lfC" "GPRINT:therm:MIN:Минимальная\:%3.2lfC">
 
</BR>
Данные на: <RRD::TIME::LAST /var/db/rrdtool/00044e42dfff.rrd "%H:%M,  %d %b %Y">
</BODY>
</HTML>

Создаю папку и установливаю владельца для хранения графиков

# mkdir /var/www/therm/png
# chown www-data:www-data /var/www/therm/png/

В /etc/apache2/conf.d создаю файлик следующего содержания:

cat therm.conf
# therm Apache configuration

Alias /therm /var/www/therm

<Directory /var/www/therm>
      DirectoryIndex index.cgi
      Options FollowSymLinks ExecCGI
      AddHandler cgi-script .cgi
      AllowOverride None
      Order deny,allow
      Allow from all
</Directory>

Перезапускаю apache

Захожу браузером на сервер: http://ip_адрес_сервера/therm

Ссылки:
http://www.linuxlinus.de/blog/raspberry-wetterstation-ds18b20-rrd-graph/

bananapi/rrdtool.txt · Последние изменения: 2015/05/24 19:50 (внешнее изменение)