[rrd-users] reversing values in rrd file

Shipley, Rob rshipley at state.mt.us
Wed Apr 10 20:57:07 MEST 2002

I am wanting to reverse the DS values from a dumped file.( rrdtool dump
sample.rrd >sample.xml)  I am attempting to do it in perl but it's not
working. Does any one have a script they use - or any idea how to do this.
I'm thinking it is an issue with substituting floating literals. 
p.s. Here is the script I am attempting to use
-------cut ----------
#target is the output xml file that will have the values reversed
#getvalues is the existing xml file
$target = $ARGV[1];
$getvalues = $ARGV[0];
open (MAIN, ">$target")|| die "open the target file.\n";
open (VALUES, $getvalues)|| die "open the values file.\n";
#Loop through the xml file from the main rrd file you want values imported
while (<VALUES>)
$valuein = $_;
if ($valuein =~
$valuein =~ s/$mds0/value1/;
$valuein =~ s/$mds1/value2/;
$valuein =~ s/value1/$mds1/;
$valuein =~ s/value2/$mds0/;
#When I print, the values are stored in $mds0 & $mds1 but don't substitute
or change unless they are NaN.
#print "values:$mds0,$mds1 -> $valuein\n";
print MAIN $valuein;

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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list