[rrd-users] Re: Can not parse any arugments with Perl RRDs

Shawn Asmussen shawn.asmussen at gmail.com
Sun Apr 9 23:39:40 MEST 2006


 On 4/5/06, mugi at pinesalad.net <mugi at pinesalad.net> wrote:
>
> Hello all,
>
> I have a bit of an odd situation with Perl RRDs not accepting any
> arguments.
>
> Following the rrdbuild.txt doc I've been able to compile rrdtool-1.2.12
> on AIX 5.3.
> In trying to run the example scripts (bigtops.pl as an example), I'm
> getting the following error:
>
> bigtops.pl: unable to create `randome.rrd': can't parse argument
> '--start'
>
> The bigtops.pl create line is:
> RRDs::create ($rrd, "--start",$start-1, "--step",300,
>              "DS:a:GAUGE:600:U:U",
>              "DS:b:GAUGE:600:U:U",
>              "RRA:AVERAGE:0.5:1:300");
>
> $start is being populated correctly and $start-1 works fine.
>
> For testing, I tried to remove "--start",$start-1, but then a "can't
> parse argument --step" happens.
> Removing "00step",300, then causes "can't parse argument 'randome.rrd'
>
> In looking at the output from building rrdtool, I don't see any errors
> when it comes to building the perl modules.
> So I'm a bit confused on what issue is causing this.
>
> There was a suggestion to build RRDs as static, but that doesn't help.
>
> I tried to run "make test" in the bindings/perl-shared directory and got
> the following results:
>
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/base....t/base.t: unable to create `demo1.rrd': can't parse argument
> '-b'
> t/base....dubious
>        Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 2-7
>        Failed 6/7 tests, 14.29% okay
> Failed Test Stat Wstat Total Fail  Failed  List of Failed
>
> -------------------------------------------------------------------------------
> t/base.t     255 65280     7   11 157.14%  2-7
> Failed 1/1 test scripts, 0.00% okay. 6/7 subtests failed, 14.29% okay.
> gmake: *** [test_dynamic] Error 2
>
>
> Running rrdtool from a prompt, the following does work:
>
> rrdtool create junk.rrd --start 1144278591 --step 300 DS:a:GAUGE:600:U:U
> DS:b:GAUGE:600:U:U RRA:AVERAGE:0.5:1:300
>
> Ther perl version is 5.8.2
>
> Does anybody have any ideas on this?

 I am going to guess that you used gcc to compile rrdtool, right? I just
recently had this exact problem under AIX 5.2, and I was going to post
something to the rrdtool-dev list as soon as I gathered all of the right
details together. Anyway, I did some debugging and traced the specific
problem that you see during the 'make test' to the use of getopt_long in
rrd_create.c. I think the problem has something to do with threading, as I
know that getopt isn't thread safe. The trouble is that after getopt is
done, the variable optind is still 0, instead of what it needs to be. I
think that there are probably other places in the code that are also using
getopt that are broken when compiled with gcc under AIX, but I didn't
investigate any further than what I found in rrd_create.c.

I recompiled rrdtool with IBM's C compiler, and after that everything
behaved normally. The trouble is only with the perl modules. If you have
IBM's C compiler available, I suggest you use that. You can use it to
compile rrdtool even if gcc was used to compile your perl distribution by
setting the appropriate environment variables like PERLCC, PERLCFLAGS,
etc... If you don't have IBM's C compiler available, I'm not sure if it's
even possible to make the perl modules work without fixing the rrdtool
source code to deal with this issue.

P.S. If you DO have the IBM C compiler, and can go with that, I just
remembered that it had a problem with one piece of the sourcecode in
rrd_gfx.c. For me, the IBM C compiler choked on the line that defines
DPRINTF if DEBUG isn't defined . I changed it from define DPRINTF(...) to
define DPRINTF() and it compiled ok for me.

Shawn Asmussen

--
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