Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Apr 2002 15:07:48 -0700
From:      Steve Carter <scarter@pobox.com>
To:        freebsd-stable@freebsd.org
Subject:   FreeBSD perl/warnings.pm
Message-ID:  <20020417150748.R32334@pobox.com>

next in thread | raw e-mail | index | archive | help
Originally send to ports and bugs but was told freebsd-stable would be a
better place.

===

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.  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:

$ 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 xxx.xxx.org_yyy.yyy.yyy.11
Rateup WARNING: /home/scarter/bin/rateup The backup log file for xxx.xxx.org_yyy.yyy.yyy.11 was invalid as well
Rateup WARNING: /home/scarter/bin/rateup Can't remove xxx.xxx.org_yyy.yyy.yyy.11.old updating log file
Rateup WARNING: /home/scarter/bin/rateup Can't rename xxx.xxx.org_yyy.yyy.yyy.11.log to 
yellowlorry.gulp.org_140.99.102.11.old updating log file

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

Voila, everything worked correctly:

$ 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

Is something wrong here?

-Steve

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




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