[mrtg] Files with extension .old

Holger van Koll Holger-ml at vanKoll.de
Mon Aug 2 15:45:54 MEST 1999

I am using mrtg to monitor (among other things) a dialup-link with a
dynamically assigned ip-address.
This is a bit tricky, as mrtg creates its gif-files and logfiles depending
on the ip-address of the device. Can I change that to have a fix name?

As I think this is not possible, I done the following:
The shellscript that is called via cron checks if I am online. If not, only
eth0 is monitored. Fine so far.

If I am online, it does the following:
IP=`cat /var/lock/online`
OLDIP=`cat /var/lock/oldip`

if test -f /usr/local/apache/htdocs/images/$OLDIP-day.gif
cd /usr/local/apache/htdocs/images
mv $OLDIP-day.gif $IP-day.gif
mv $OLDIP-month.gif $IP-month.gif
mv $OLDIP-week.gif $IP-week.gif
mv $OLDIP-year.gif $IP-year.gif
mv $OLDIP.html $IP.html
mv $OLDIP.log $IP.log
mv $OLDIP.old $IP.old
cd /root/sw/mrtg-2.8.6/run
cp -f mrtg-o1.cfg mrtg-on.cfg        #mrtg-o1.cfg is the first part of the
config-file containing workdir etc.

echo "Target[$IP]: 3:public at kserver" >>mrtg-on.cfg
echo "MaxBytes[$IP]: 8000" >>mrtg-on.cfg
echo "Title[$IP]: kserver.localdomain ($IP): ippp0" >>mrtg-on.cfg
echo "PageTop[$IP]: <H1>Traffic Analysis for ippp0" >>mrtg-on.cfg

That seems to work. However, sometimes I get the following message from
Rateup WARNING: .//rateup could not read the primary log file for
Rateup WARNING: .//rateup The backup log file for was invalid
as well
Rateup WARNING: .//rateup Can't remove updating log file
Rateup WARNING: .//rateup Can't rename to updating log file

and 15 min later:
mv: No such file or directory
Rateup WARNING: .//rateup Can't remove updating log file

Whats so special about that .old-file? Is it created everytime mrtg runs?

* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg

More information about the mrtg mailing list