[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
then
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
fi
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
[snip]

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

and 15 min later:
mv: 193.159.34.155.old: No such file or directory
Rateup WARNING: .//rateup Can't remove 193.159.34.76.old 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