Archive for the ‘freebsd’ Category

MRTG, Perl, FindBin and blogs

Wednesday, March 16th, 2005

Today proved again that blogs can be so useful!

Today I discovered that the mrtg user I created that runs all the mrtg processes had a huge mailbox and was getting new mail every time mrtg ran from the crontab.:

Use of uninitialized value in string at /usr/local/bin/mrtg line 78.
Empty compile time value given to use lib at /usr/local/bin/mrtg line 78
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/mrtg line 79.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/mrtg line 703.
Use of uninitialized value in concatenation (.) or string at /usr/local/bin/mrtg line 703.
ERROR: Can't Execute '/rateup'

So I did a Google and whaddayaknow, this blog turned up, supplying me the answer for the above problem:

In stead of

*/5 * * * * mrtg  /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg  --logging /var/log/mrtg.log

You should use:

*/5 * * * * mrtg  cd /tmp; /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg  --logging /var/log/mrtg.log