[rrd-users] Unable to specify which version of RRDs perl module to use
David Ball
davidtball at gmail.com
Mon Apr 16 00:37:14 CEST 2007
After working on this all weekend, i have more information which
hopefully will prompt someone to recognize something I'm missing/doing
wrong. I don't believe it's RRDTool's problem per se, but after
spending 2 days in #perl on Freenode, I'm desperate.
I have rrdtool-1.0.something installed, and RRDs.pm is in the main
site perl directory (/usr/lib/perl5/5.6.1/RRDs.pm). I do not wish to
use these versions with the script I'm currently working on though.
So, I have installed 1.2.19 in /usr/local/rrdtool-1.2.19/ and its
RRDs.pm is in /usr/local/rrdtool-1.2.19/lib/perl/5.6.1/i386-linux/RRDs.pm.
In order to use these, I'm specifying:
use lib '/usr/local/rrdtool-1.2.19/lib/perl/5.6.1/i386-linux';
use RRDs;
This all seems to work fine if I call my script from the command
line. However, when I call it from a web form, it REFUSES to use my
newer RRDs.pm, and it reverts to the old version instead. To debug, I
print @INC immediately after my 'use lib' statement. Cmd line AND web
form invocations show that my lib path is being prepended on @INC.
But when called from a web form, $INC{'RRDs.pm'} is always set to the
OLD one. I then added a:
if (-r '/usr/local/rrdtool-1.2.19/lib/perl/5.6.1/i386-linux/RRDs.pm')
to make sure the web user (apache) can read the file, and it CAN.
So, I can't figure out for the LIFE of me why my script won't use the
newer RRDs.pm.
Any insight would be very well received. Cheers.
David
On 4/13/07, David Ball <davidtball at gmail.com> wrote:
> Hey there. I have an existing installation of RRDTool using ver
> 1.0.something, and am still using that in production.
> I have also installed 1.2.19 in a different location. The RRDs
> perl module of the new version isn't in the main site-perl location,
> so in the scripts I'm developing with the new rrdtool, I'm using:
>
> use lib ''/usr/local/rrdtool-1.2.19/lib/perl';
> use RRDs;
>
> in hopes of being able to use the new RRDs module. Any calls to
> rrdtool binary in the new script also go to the new version of rrdtool
> (basically trying to use nothing but the NEW versions).
> Unfortunately, I'm using the RRDs module to do a 'fetch', but it's
> failing, saying:
>
> can't handle RRD file version 0003
>
> which almost certainly indicates that the script is using the OLD
> RRDs perl module. I confirmed that the script IS updating its @INC
> array, as I see the new paths on the front of the array during a
> print. The path:
> /usr/local/rrdtool-1.2.19/lib/perl/5.6.1/i386-linux
> appears in it, and that's where RRDs.pm is located.
>
> Anyone see something I may be missing? Thanks in advance for any advice.
>
> David
>
More information about the rrd-users
mailing list