Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Apr 2002 18:13:15 -0700
From:      Steve Carter <scarter@pobox.com>
To:        freebsd-ports@freebsd.org, freebsd-bugs@freebsd.org
Subject:   FreeBSD perl/warnings.pm
Message-ID:  <20020416181315.G32334@pobox.com>

next in thread | raw e-mail | index | archive | help
I am not subscribed to bugs so copy me on the email or port to ports.

I was playing w/ mrtg today ... basically trying to add a second instance
for some remote systems I am monitoring.  Not wanting to goof with my
current config file I created another.

After screwing about for a while I broke the rules and looked at the
documentation; there is an option to have mrtg log to a file:

$ mrtg yl.mrtg.cfg --logging yl.mrtg.log

So I ran it and get this:

$ cat yl.mrtg.log 
2002-04-16 16:45:01 -- Started mrtg
2002-04-16 16:45:01 -- Can't locate warnings.pm in @INC (@INC contains: 
/usr/local/bin/../lib/mrtg2 /usr/local/bin /usr/libdata/perl/5.00503/mach 
/usr/libdata/perl/5.00503 
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd 
/usr/local/lib/perl5/site_perl/5.005 .) at (eval 6) line 1.
2002-04-16 16:45:01 -- Callback called exit at /usr/local/bin/mrtg line 1.
2002-04-16 16:45:01 -- END failed--cleanup aborted at /usr/local/bin/mrtg line 1.

It seems like the warnings.pm module is missing from FreeBSD default perl
(as in /usr/bin/perl).  I installed a later version of perl (resides in
/usr/local/bin) on my machine from the perl cpan utility and I have
warnings.pm within it:

$ locate warnings.pm
/usr/local/lib/perl5/5.6.1/warnings.pm

so I copied /usr/local/bin/mrtg and /usr/local/bin/rateup (because mrtg
uses $PWD or similar to find rateup) to $HOME/bin and changed it so that
it uses /usr/local/bin/perl rather than /usr/bin/perl then tried again:

$ pwd
/usr/local/www/mrtg
$ ls y*
yl.mrtg.cfg
$ ~/bin/mrtg yl.mrtg.cfg --logging yl.mrtg.log 
Rateup WARNING: /home/scarter/bin/rateup could not read the primary log file for yellowlorry.gulp.org_140.99.102.11
Rateup WARNING: /home/scarter/bin/rateup The backup log file for yellowlorry.gulp.org_140.99.102.11 was invalid as well
Rateup WARNING: /home/scarter/bin/rateup Can't remove yellowlorry.gulp.org_140.99.102.11.old updating log file
Rateup WARNING: /home/scarter/bin/rateup Can't rename yellowlorry.gulp.org_140.99.102.11.log to 
yellowlorry.gulp.org_140.99.102.11.old updating log file
[scarter@good] 

One can ignore these WARNING (heheh) messages because it's the 1st time 
the mrtg data and png files are accessed.

Voila:

$ ls y*
xxx.xxx.org_yyy.yyy.yyy.11-day.png
xxx.xxx.org_yyy.yyy.yyy.11-month.png
xxx.xxx.org_yyy.yyy.yyy.11-week.png
xxx.xxx.org_yyy.yyy.yyy.11-year.png
xxx.xxx.org_yyy.yyy.yyy.11.html
xxx.xxx.org_yyy.yyy.yyy.11.log
yl.mrtg.cfg
yl.mrtg.log
yl.mrtg.ok

BTW, just copying warnings.pm into the FreeBSD perl directory does not
work and one gets other errors.

-Steve

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020416181315.G32334>