variable name in "data" ... don"t really know how to say it...

variable name in "data" ... don"t really know how to say it...

am 26.05.2011 19:18:51 von PetePDX

I want to update a rrd database file, I'm using RRDTool::OO the data
is coming out of a database table.
each row in the database has in it two columns that are the dsname and
the associated value.

to insert a record using RRDTool::OO one does

$rrd->update(time => $time, values => [$val1, $val2, ...]);

or

$rrd->update(time => $time,
values => { $dsname1 => $val1,
$dsname2 => $val2, ...});

My data is coming out of a SQL database table where the first column
is the dsname and the second column is the value.

I'm using DBI/DBD with a select for example

.... SELECT height, weight from foo where sampletime = $time ...

and using one of the fetch's to get for example

|dsname|value|
|height|12|
|weight|100|

and then the challange, do the rrd update

$rrd->update(time => $time,
values => { "height " => 12,
"weight" => 100});

One (or more) dsnames can be missing, and the order the appear may
then be different)

In the case I'm working on now there can be up to 12 unique dsnames.

-pete


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: variable name in "data" ... don"t really know how to say it...

am 06.06.2011 09:57:40 von Chris Nehren

On Thu, May 26, 2011 at 10:18:51 -0700 , PetePDX wrote:
>
>
> I want to update a rrd database file, I'm using RRDTool::OO the data
> is coming out of a database table.
> each row in the database has in it two columns that are the dsname and
> the associated value.

Pete, perhaps the reason that your message to the list hasn't garnered
any responses is because you haven't asked a question that anyone can
help you with. I read your message and wasn't sure how to provide
guidance as you didn't describe where you're having trouble. If you can
be more specific in what's going wrong, we can help.

--
Chris Nehren | Coder, Sysadmin, Masochist
Shadowcat Systems Ltd. | http://shadowcat.co.uk/

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/