[rrd-users] rrdtool RRDp::cmd problem

Aaron Wiebe epiphani at gmail.com
Tue Nov 25 19:57:31 CET 2008


Greetings all,

I'm running into a situation where attempting to run the RRDp::cmd()
call from within perl is resulting in a hung application...  I'm not
sure exactly what RRDp::cmd() is doing with the command, but something
in how the arguments are being parsed is resulting in rrdtool
expecting more, and simply hanging on a read of stdin.

The commandline is built in a string.  This string can contain
multiple arguments with lots of quotations and so forth.  Given that
RRDp::cmd() requires an array passed, I'm using Text::Shellwords() to
split the commandline I've built into an array.

When passing this to RRDp::cmd(), it simply hangs.  Copy and pasting
the string into the commandline works.  An actual example:

$cmd = 'graph testing5-cpu.png --start 1227638395 --end 1227638396 -t
"CPU Utilization" -v "% CPU" DEF:Wait=testing5-cpu.rrd:Wait:AVERAGE
AREA:Wait\#ff0000:"Wait CPU"
DEF:System=testing5-cpu.rrd:System:AVERAGE
STACK:System\#0000cd:"System CPU"
DEF:User=testing5-cpu.rrd:User:AVERAGE STACK:User\#1e90ff:"User CPU"';

@tmp = shellwords($cmd);

foreach $c (@tmp) {
    print "$c\n";
}

Prints:

graph
testing5-cpu.png
--start
1227638395
--end
1227638396
-t
CPU Utilization
-v
% CPU
DEF:Wait=testing5-cpu.rrd:Wait:AVERAGE
AREA:Wait#ff0000:Wait CPU
DEF:System=testing5-cpu.rrd:System:AVERAGE
STACK:System#0000cd:System CPU
DEF:User=testing5-cpu.rrd:User:AVERAGE
STACK:User#1e90ff:User CPU

Any assistance would be appreciated!  Thanks,
-Aaron



More information about the rrd-users mailing list