> > 1.       Modify MRTG_lib.pm to identify multiple use of these
> directives, and
> > push the values into @INC or $ENV{PATH} straight away, or
> >
> > 2.       Allow multiple values to be specified (possibly colon
> separated?)
> >
> 
> I would recommend #2, being consistent with LoadMibs.  In the case of
> LoadMibs, the different mibs are space separated.

I agree - space separated is better, since Windows needs colons for drive 
letters, and VMS as path separators.  Plus, as you say, it is more consistent 
with LoadMibs.  Checking the code, LoadMibs seems to support comma separated as 
well...

To do this, I think that around line 800 of MRTG_lib.pm, we would need 
something like:

    if(defined $$cfg{pathadd}){
        foreach my $p (split /[,\s]+/, $$cfg{pathadd}) {
          ensureSL(\$p);
          $ENV{PATH} = "${p}${MRTG_lib::PS}$ENV{PATH}";
        }
    }
    if(defined $$cfg{libadd}){
        foreach my $p (split /[,\s]+/, $$cfg{libadd}) {
          ensureSL(\$p);
          debug('eval',"libadd $p\n");
          local $SIG{__DIE__};
          eval "use lib qw( $p )";
        }

... to replace the existing parts.  This is very similar to the LoadMibs 
processing immediately above.  I've implemented it on our test server and it 
looks good so far.  Will probably be more work updating the documentation!

Thoughts?

Steve

Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 924 6487
Mobile: +64 (0)21 753 189
Email: [email protected]
 Please consider the environment before printing this e-mail 


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to