[rrd-users] Re: determining invalid values using RRDs vs rrdtool fetch

Peter Valdemar Mørch swp5jhu02 at sneakemail.com
Sat Mar 18 14:48:19 MET 2006


Ann Gentile gentile-at-dancer.ca.sandia.gov |Lists| wrote:
> whereas using: 
> 
> 	my ($start,$step,$names,$data) = RRDs::fetch ... 
> 	 foreach my $line (@$data) {
> 	   print "  ", scalar localtime($start), " ($start) ";
> 	   $start += $step;
> 	   foreach my $val (@$line) {
> 	     printf "%12.1f ", $val;
> 	   }
> 	   print "\n";
> 	 }
> 
> prints out:
> 	1142539080         23.5
>         1142539140          0.0

Hi there,

I'm pretty sure the RRDs::.* subs return the perl undef value (not the 
"undef" string) where the CLI verison returns the string "NaN". Did you 
try running your script from above using the -w / enable warnings flag 
to perl? Doesn't printf printout 0.0 because $val was undef and issue a 
warning too?

Try this instead:
use warnings;
...
...
use Data::Dumper;
# to see the "real" data structure....
print Dumper($data);

Peter

-- 
Peter Valdemar Mørch
http://www.morch.com

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list