Re: [collectd] Issue With Graphite Perl Plugin

2011-07-06 Thread Sebastian Harl
Hi,

On Tue, Jul 05, 2011 at 08:56:43PM -0500, Tom Purl wrote:
 I then tried to use the collectd-graphite plugin
 (https://github.com/joemiller/collectd-graphite).

Oh, I didn't know about this plugin yet … sounds quite interesting.
Would you (or somebody else) mind adding a page to the wiki and add it
to http://collectd.org/wiki/index.php/List_of_front-ends ;-)

 It uses the perl
 plugin, so I added the following to my config file:
 
 LoadPlugin perl
 Plugin perl
 IncludeDir /usr/local/share/perl/5.10.1
 BaseName Collectd::Plugins
 LoadPlugin Graphite
 Plugin Graphite
   Buffer 256000
   Prefix servers
   Host   localhost
   Port   2003
 /Plugin
 /Plugin
 
 I know that I didn't set the Global property to true, but from what
 I understand, that's not necessary in the 5.0 version of collectd.

collectd 5.0 automatically sets that flag for some plugins (those, that
are known to benefit from that). So, the flag is required (when using
plugins that are [in parts] written in C) but it does not have to be set
explicitly.

 Then, when I try to start collectd, I get the following errors:
 
 [2011-07-05 20:42:31] plugin_load_file: The global flag is not
 supported, libtool 2 is required for this.

This is a result of automatically adding the global flag for the perl
plugin (NB: we should check for libtool 2 as well, when automatically
setting that flag). I suggest to recompile collectd with libtool 2
(which is available since Ubuntu Lucid) even though that might not be
necessary in your case … but better be sure and safe for the future ;-)

 [2011-07-05 20:42:31] perl: Initializing Perl interpreter...
 Can't locate Collectd.pm in @INC (@INC contains:
 /usr/local/share/perl/5.10.1 /etc/perl /usr/local/lib/perl/5.10.1
 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5
 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .).
 BEGIN failed--compilation aborted.

 Here's the contents of my /usr/local/share/perl/5.10.1 directory:
 
 ./Collectd
 ./Collectd/Plugins
 ./Collectd/Plugins/Graphite.pm
 
 These files should be readable by the collectd daemon because it is
 running as root.
 
 So it appears to me that collectd can't find Collectd.pm in
 /usr/local/share/perl/5.10.1, but that should be ok since a Collectd
 folder is in there, right?

Nope, you need Collectd.pm as well … that's part of the perl plugin
(implemented in plain Perl). It should have been installed during 'make
install' as well. The default is ${prefix}/share/perl/perl_version/
(${prefix} defaults to /opt/collectd/). Either copy Collectd.pm to any
of the directories in @INC (see above) or add the path to Collectd.pm to
the IncludeDir config option.

 Does anyone have any idea what I'm doing wrong? Is this an issue with
 the perl plugin, or should I contact the author of the
 collectd-graphite plugin?

Making Collectd.pm available to the perl plugin should fix your problem.
As a second step, I recommend to recompile with libtool2 -- else, some
third-party perl modules cannot be used with the perl plugin.

HTH,
Sebastian

-- 
Sebastian tokkee Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature
___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Issue With Graphite Perl Plugin

2011-07-06 Thread Sebastian Harl
Hi again,

On Wed, Jul 06, 2011 at 07:22:17AM -0500, Tom Purl wrote:
 On 7/6/11, Sebastian Harl s...@tokkee.org wrote:
  Oh, I didn't know about this plugin yet … sounds quite interesting.
  Would you (or somebody else) mind adding a page to the wiki and add it
  to http://collectd.org/wiki/index.php/List_of_front-ends ;-)
 
 I'll be happy to once I get it up-and-running :)

Great :-)

Some screenshots would be nice as well, btw. ;-)

  Then, when I try to start collectd, I get the following errors:
 
  [2011-07-05 20:42:31] plugin_load_file: The global flag is not
  supported, libtool 2 is required for this.
 
  This is a result of automatically adding the global flag for the perl
  plugin (NB: we should check for libtool 2 as well, when automatically
  setting that flag). I suggest to recompile collectd with libtool 2
  (which is available since Ubuntu Lucid) even though that might not be
  necessary in your case … but better be sure and safe for the future ;-)
 
 How do I explicitly enable libtool 2 when I compile? Here's the
 version of that libtool that I have on the system now (and when I
 compiled 5.0):
 
 tom@millhouse:/opt/collectd/sbin$ sudo dpkg -l |grep libtool
 ii  libtool  2.2.6b-2ubuntu1
   Generic library support script
 
 I don't see an explicit libtool option for the configure script. Is
 there something I'm missing?

Sorry, I forgot to mention that you need libltdl as well. libtool is the
command line program used at build time while that lib is used by
collectd. In Ubuntu, the required package should be libltdl-dev.

  So it appears to me that collectd can't find Collectd.pm in
  /usr/local/share/perl/5.10.1, but that should be ok since a Collectd
  folder is in there, right?
 
  Nope, you need Collectd.pm as well … that's part of the perl plugin
  (implemented in plain Perl). It should have been installed during 'make
  install' as well. The default is ${prefix}/share/perl/perl_version/
  (${prefix} defaults to /opt/collectd/). Either copy Collectd.pm to any
  of the directories in @INC (see above) or add the path to Collectd.pm to
  the IncludeDir config option.
 
 Thanks! I set my IncludeDir value to /opt/collectd/share/perl/5.10.1
 and restarted, so I'm not getting that error any more. Unfortunately,
 I'm now getting this error:
 
 Can't load '/usr/lib/perl/5.10/auto/threads/threads.so' for module
 threads: /usr/lib/perl/5.10/auto/threads/threads.so: undefined symbol:
 PL_no_mem at /usr/lib/perl/5.10/XSLoader.pm line 70.
  at /usr/lib/perl/5.10/threads.pm line 32
[…]
 I found a few posts that said I should run this before I start collectd:
 
 export LD_PRELOAD=/usr/lib/libperl.so.5.10.1
 
 However, this didn't seem to help.

Hrm, that should still work … anyway, I don't currently have time to see
why that could fail.

 Am I getting this because of the missing libtool dependency?

Right.

 Also, why do you suppose it's looking for
 a Perl 5.10 plugin if I'm using 5.10.1?

The 5.10 directory is a symlink to the latest Perl version, i.e.
5.10.1 in your case.

HTH,
Sebastian

-- 
Sebastian tokkee Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature
___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd