[rrd-users] Question about rrd::fetch

Laura McCord mccordl at southwestern.edu
Mon Sep 29 21:36:11 CEST 2008


I noticed that if I specify the start as '0' then it will get the 
current date at midnight. Is this true or is my code figuring this out 
coincidently? I was trying to graph the current day's statistics 
starting at midnight, which below it ends up working, but I am not sure 
if this is the correct way to go about this.

       
        my $res = 60*60*24;

        # Start at today
        #my $time = time;
        #my $start_t = $time - ($time % $res);

        #my $start_t_res = int($start_t/$res)*$res;
        my $start_t_res = 0;
        #End on Today's Date
        #my $end_t = "(int($start_t/$res)*$res)";

        my ($start,$step,$names,$data) = 
RRDs::fetch("stats.rrd","AVERAGE","-r","$res","-s", 
"$start_t_res","-e","now");

Thanks,
Laura



More information about the rrd-users mailing list