Hello,<br>thank you for your answer,<br>but i think your idea is the same as making all in the loop to build it in one go<br>the problem is: when i made rrdtool info rrd_file.rrd ,only one RRA is created and took the last value of pdp and nb: it's mean pdp3 and nb3<br>
<br><div class="gmail_quote">2011/7/7 Simon Hobson <span dir="ltr"><<a href="mailto:linux@thehobsons.co.uk" target="_blank">linux@thehobsons.co.uk</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>fadwa salam wrote:<br>
<br>
>I want to do a loop to create RAR archives by varying each time<br>
>pdp_per_row and number of records that will be given as arguments.<br>
><br>
> rrdtool create $ rrd \<br>
> - start $ now \<br>
> - step = $ step \<br>
> DS: Power: GAUGE: 600: U: U<br>
> RRA: AVERAGE: 0.5: $ pdp $ nb<br>
><br>
>The problem is that I can not handle RAR alone. They are linked to<br>
>the process of the creation.<br>
><br>
>if I put the whole process of creation inside the loop ,it create a<br>
>single RAR archive and take the last value.<br>
<br>
</div></div>If I understand this correctly, you want build up an RRA piecemeal -<br>
create the basic file and then add RRAs to it one by one.<br>
<br>
This is not supported by RRD, you are expected to build it in one go<br>
- like this :<br>
<div><br>
rrdtool create $ rrd \<br>
- start $ now \<br>
- step = $ step \<br>
DS: Power: GAUGE: 600: U: U<br>
</div> RRA: AVERAGE: 0.5: $pdp1 $nb1<br>
RRA: AVERAGE: 0.5: $pdp2 $nb2<br>
RRA: AVERAGE: 0.5: $pdp3 $nb3<br>
<br>
Whilst there are tools for adjusting RRD files, I don't think it<br>
would be easy (or even possible ?) to do what you want with them.<br>
<br>
Possibly your best approach would be to make a "wrapper script" to<br>
consolidate the steps and then make one call to create the RRD file.<br>
Something along these lines :<br>
<br>
cmd_text="- start $ now \<br>
- step = $ step \<br>
DS: Power: GAUGE: 600: U: U \<br>
"<br>
<br>
while <some condition> do<br>
<get consolidation><br>
cmd_text=`echo "${cmd_text} RRA:${cf_func}:${hb}:${pdp}:{nb} \<br>
"`<br>
done<br>
rrdtool create $ rrd ${cmd_text}<br>
<br>
--<br>
Simon Hobson<br></blockquote></div><br>