<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.emailstyle17
        {mso-style-name:emailstyle17;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.emailstyle18
        {mso-style-name:emailstyle18;
        font-family:"Arial","sans-serif";
        color:navy;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=NL link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’m a newbie with
rrdtool. How do I create a rrd file for a counter? Most examples use
temperatures and I don’t seem t get it working.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Rob Conway [mailto:rjconway@bigpond.com] <br>
<b>Sent:</b> maandag 16 februari 2009 21:25<br>
<b>To:</b> rrd-users@lists.oetiker.ch<br>
<b>Cc:</b> 'Eduard'<br>
<b>Subject:</b> RE: [rrd-users] help with NSLU2, OWFS and RRD for DS2423
counter<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Here is my read script (started life in a NSLU2 –no runs under
ubuntu), once started it loops every 90 seconds and uses a simple bash
script. Each section has a description and you can see how to convert the
counts into a real number. See Accum_flow as the counts divided by 4100 =
litres in my case</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>#!/bin/bash</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>OWWRITE="/opt/owfs/bin/owwrite -s 3001"</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>OWREAD="/opt/owfs/bin/owread -s 3001"</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>AWK="/usr/bin/awk"</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>hwclock -s</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>echo "`date` -- 1Wire Data Collection Script Started -- "
>>/var/scripts/nohup.out</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>while true</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>do</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>### Force Simulataneous 1wire conversion ###</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>$OWWRITE simultaneous/voltage 1</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>$OWWRITE simultaneous/temperature 1</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>### Read 1wire data and convert into engineering units #ph was
2.6667 offset was .3##</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>PH=$($OWREAD 20.022408000000/volt.A | $AWK ' {printf
"%4.2f\n",(($0-0.0)-1)/1.6+5.5 }')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>US=$($OWREAD 20.022408000000/volt.B | $AWK '{printf
"%3.0f\n",(($0-0.0)*100)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>ORP=$($OWREAD 20.022408000000/volt.D | $AWK '{printf
"%3.0f\n",(($0-0.0)*99)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>TempAqua=$($OWREAD 20.022408000000/volt.C | $AWK '{printf
"%3.1f\n",(((($0-0.0)-1)*5)+20)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>LITRES=$($OWREAD 20.952A05000000/volt.D | $AWK '{printf
"%3.1f\n",(($0-2.94)*62)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>TempOut=$($OWREAD 28.11BF97000000/temperature | $AWK '{printf
"%3.1f\n",($0)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>TempAmb=$($OWREAD 28.D70598000000/temperature | $AWK '{printf
"%3.1f\n",($0)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>TempRes=$($OWREAD 28.A6EE97000000/temperature | $AWK '{printf
"%3.1f\n",($0)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Accum_flow=$($OWREAD 1D.EBEF0900000034/counters.A | $AWK '{printf
"%g\n",($0/4100)}')</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>### Out of Range Error trap -Do not log data ###</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>PHtest=`echo $PH |cut -f1 -d'.'`</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>if [ -z $PHtest ] || [ $PHtest -gt 8 ]; then</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>echo "`date` PH reading error $PH"
>>/var/scripts/nohup.out</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>PH="U"</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>fi</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>ORPtest=`echo $ORP |cut -f1 -d'.'`</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>if [ -z $ORPtest ] || [ $ORPtest -gt 600 ]; then</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>echo "`date` ORP reading error $ORP"
>>/var/scripts/nohup.out</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>ORP="U"</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>fi</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>UStest=`echo $US |cut -f1 -d'.'`</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>if [ -z $UStest ] || [ $UStest -gt 500 ]; then</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>echo "`date` Conductivity reading error $US"
>>/var/scripts/nohup.out</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>US="U"</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>fi</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>TEMPtest=`echo $TempAqua |cut -f1 -d'.'`</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>if [ -z $TEMPtest ] || [ $TEMPtest -gt 33 ] ; then</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>echo "`date` Aquarium Temp error $TempAqua"
>>/var/scripts/nohup.out</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>TempAqua="U"</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>fi</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>### Calculations based upon Data ###</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>C12=$($AWK -v PH="$PH" '{printf "%3.1f\n",((3*$0)*(10^(7-PH)))}'
/var/scripts/kh_value.txt)</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Todayflow=$($AWK -v AF="$Accum_flow" '{printf
"%g\n",(AF-$0)}' /var/scripts/lastflow.txt)</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Weekflow=$($AWK -v AF="$Accum_flow" '{printf
"%g\n",(AF-$0)}' /var/scripts/weekflow.txt)</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>### Push Data into NEW Trend Files ###</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_ph.rrd N:$PH</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_orp.rrd N:$ORP</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_temp.rrd N:$TempAqua:$TempRes</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_co2.rrd N:$C12</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_cond.rrd N:$US</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_level.rrd N:$LITRES</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/weather_temp.rrd N:$TempAmb:$TempOut</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>rrdtool update /var/www/rrd/aqua_waterchange.rrd
N:$Todayflow:$Weekflow</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>sleep 90</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>done</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'> </span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>-----Original
Message-----<br>
<b>From:</b> rrd-users-bounces@lists.oetiker.ch
[mailto:rrd-users-bounces@lists.oetiker.ch] <b>On Behalf Of </b>Eduard<br>
<b>Sent:</b> Tuesday, February 17, 2009 7:00 AM<br>
<b>To:</b> rrd-users@lists.oetiker.ch<br>
<b>Subject:</b> [rrd-users] help with NSLU2, OWFS and RRD for DS2423 counter</span><span
lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US>Are there users
who are using RRD and OWFS with a NSLU2 ?<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> I’m
interested in how to update a RRD with data from a DS2423 counter.
Does anybody have some working examples for me?<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span lang=EN-US>Kind regards,<br>
<br>
Eduard<o:p></o:p></span></p>
<p><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>No virus
found in this incoming message.<br>
Checked by AVG - www.avg.com<br>
Version: 8.0.237 / Virus Database: 270.10.24/1954 - Release Date: 02/15/09
18:09:00</span><o:p></o:p></p>
</div>
</body>
</html>