[rrd-users] Fwd: start time
Hello, I'm sorry to bother you again, I tried what you sent me. It gives me the following result: period=300 time=3600 end=`date +%s` gives => end=1309521104 end=$(( ( ${end} / ${period} ) * ${period} )) => after this operations it gives end=1309520880 time=$(( ( ${time} / ${period} ) * ${period} ))=> time don't change after operations time=3600 start=$(( ${end} - ${time} ))=> this operations gives the value of start start=1309517280 it shows ok, but when i run rrdtool fetch it does not accept the value 3600 rrdtool fetch $rrd AVERAGE -r $period -s $time => ERROR: start time: did you really mean month 3600? thank you very much. ___ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
[rrd-users] Fwd: start time
Hello, I have another question : the time of the creation of the database must be less than the update time ERROR : illegal attempt to update using time 1309519420 when last update time is 1309520243 (minimum one second step) ___ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Re: [rrd-users] Fwd: start time
Hello. man rrdfetch says something about the format -s accepts: "--start|-s start (default end-1day) start of the time series. A time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default, one day worth of data will be fetched. See also AT-STYLE TIME SPECIFICATION section for a detailed explanation on ways to specify the start time." So -s 3600 is not valid, except you are trying to access data from Thu Jan 1 01:00:00 UTC 1970 So you should use an unix timestamp (e.g. -s 1309512280) or use a negative number to specify a relative offset. HTH, Andreas Maus. On 07/01/11 14:08, fadwa salam wrote: > Hello, > > I'm sorry to bother you again, I tried what you sent me. It gives me the > following result: > period=300 > time=3600 > > end=`date +%s` gives => end=1309521104 > > end=$(( ( ${end} / ${period} ) * ${period} )) => after this operations it > gives end=1309520880 > > time=$(( ( ${time} / ${period} ) * ${period} ))=> time don't change after > operations time=3600 > > start=$(( ${end} - ${time} ))=> this operations gives the value of start > start=1309517280 > > it shows ok, but when i run rrdtool fetch it does not accept the value 3600 > > rrdtool fetch $rrd AVERAGE -r $period -s $time => ERROR: start time: did > you really mean month 3600? > > thank you very much. > > > > > ___ > rrd-users mailing list > rrd-users@lists.oetiker.ch > https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users -- Dipl.-Ing. Andreas Maus science+computing ag System Administration Hagellocher Weg 73 tel.: +49 7071 9457 671 72070 Tuebingen, Germany fax: +49 7071 9457 411 www.science-computing.de -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Philippe Miltin Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Re: [rrd-users] Fwd: start time
fadwa salam wrote: >it shows ok, but when i run rrdtool fetch it does not accept the value 3600 > >rrdtool fetch $rrd AVERAGE -r $period -s $time => ERROR: start >time: did you really mean month 3600? That's because you have given it the wrong start time ! 3600s is back in January 1970. You want : rrdtool fetch ${rrd} AVERAGE -r ${period} -s ${start} -e ${end} BTW - as a general comment on coding standards, my preference is to include the {} even when not needed. The main reason is that there are several situation where they are needed, and it's easy to miss them out when you should include them, leading to incorrect results. Eg, suppose your program creates several temporary files, you might do something like : tmp_fil="/var/`something that generates a random name`" > "$tmpone" > "$tmptwo" This will fail because the shell expands $tmpone and $tmptwo to empty strings, giving the effective code : > > Whereas using : > "${tmp}one" > "${tmp}two" will work as shell expansion gives this : > "/var/one" > "/var/two" Quotes are also a good idea, otherwise your code breaks when someone uses a path containing a space, etc. Just a couple of tips so you don't need to learn it the way most of us did ;-) -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. ___ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Re: [rrd-users] Fwd: start time
fadwa salam wrote: >the time of the creation of the database must be less than the >update time > > ERROR : illegal attempt to update using time 1309519420 when last >update time is 1309520243 (minimum one second step) Yes. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books. ___ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users