The config option "libdir" is not used in test mode "-t" to find RRDs.pm.
If the RRDs.pm is not installed in the standard @INC, the RRDs.pm
is not found in test mode. The config_cache is properly written
but in test mode the new values are not used perhaps via
TG::open_cached_config. See the following error output:
INFO: reading configuration
INFO: parsed config file '/var/log/tg/localhost.tg'
INFO: preparing graph generation - checking targets
INFO: checking threshold settings
WARNING: cannot prepare query for datasource 'localhost' file '/var/log/tg/localhost.tg':
WARNING: cannot load perl module RRDs, check 'libdir' setting
NOTICE: exiting
here is the snippet from localhost.tg:
basedir /var/log/tg;
libdir /usr/local/rrdtool/lib/perl;
with the following patch in togatherd the RRDs.pm gets found:
(don't know whether this is the best place, perhaps there should
be a call at the right time to open_cached_config)
--- old/togatherd Tue May 22 18:11:32 2001
+++ new/togatherd Tue May 22 18:10:02 2001
@@ -1077,6 +1077,10 @@
}
# re-setup syslog according to new config
$tg->setup_syslog(1) unless $opts{'dontfork'} || $opts{'test'};
+ # re-setup @INC according to new config
+ if (my @libs = $tg->get('libdir')) {
+ eval 'use lib @libs';
+ }
my $source_count = prepare_datasources(@files);
return $source_count if $opts{'test'};
$tg->dolog('V1',"preparing SNMP queries");