Log files says I'm running 2 copies

Alan McKay <[email protected]>
Newsgroups gmane.network.mrtg.user
Message-ID <CAH8ZPGnWp_1_8bfu+HWbkAZM2J8D_aXOS3n2SA5t9po-RQeWRA@mail.gmail.com>
OK I fixed the 32 bit problem thanks to feedback - just had to change my
runmrtg to call for the right counter.

But now my log file says I have 2 jobs running for one of my switches but
that makes no sense.  I did not change anything in my cron tabs and this
never showed up before the change.

2013-03-02 10:30:02 -- Started mrtg with config
'/var/www/mrtg/192.168.160.3.cfg'
2013-03-02 10:30:02 -- Started mrtg with config
'/var/www/mrtg/192.168.160.9.cfg'
2013-03-02 10:30:02 -- Saturday, 2 March 2013 at 10:30: ERROR: It looks as
if you are running two copies of mrtg in parallel on
       the same config file. There is a lockfile (/var/lock/mrtg/mrtg_l)
and it is
       is only 0 seconds old ... Check your crontab.
       (/etc/crontab and /var/spool/cron/root)

All I did was change my script that calls cfgmaker then ran it manually
(otherwise it gets run nightly in case there were any changes on the switch
that day)

[root@solexa-db mrtg]# more runmrtgcfgmaker
#!/bin/bash
#
# this needs to be run periodically so that MRTG will pick up any new
# ports that were previously not being used, but are now.  Once to thrice
# daily is sufficient.  Here is the Linux crontab entry for once daily
# at 2:01 AM :
#
# 01 02 * * *     /localdisk/opt/bin/runmrtgcfgmaker

BASEDIR=/var/www/mrtg

if [ $# -ne 0 ]
then
DIRNAME=`dirname $0`
ETCDIR="$DIRNAME/../etc"
NODEFILE="$ETCDIR/MRTGnodes"
STACKS=`grep -v "^#" $NODEFILE`
else
STACKS="192.168.160.9 192.168.160.3"
while [ $# -gt 0 ]
do
STACKS="$1 $STACKS"
shift
done
fi

for stack in $STACKS
do
echo $stack
pw=public
echo "cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]:
bits,growright' --output /var/www/mrtg/$stack.cfg $pw@$stack:::::2"
cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]:
bits,growright' --output /var/www/mrtg/$stack.cfg $pw@$stack:::::2
done
[root@solexa-db mrtg]#



[root@solexa-db mrtg]# cat /etc/cron.d/mrtg
MAILTO=""
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg
/var/www/mrtg/192.168.160.9.cfg --lock-file /var/lock/mrtg/mrtg_l
--confcache-file /var/lib/mrtg/mrtg.ok --logging /var/log/mrtg.log
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg
/var/www/mrtg/192.168.160.3.cfg --lock-file /var/lock/mrtg/mrtg_l
--confcache-file /var/lib/mrtg/mrtg.ok --logging /var/log/mrtg.log



-- 
“Don't eat anything you've ever seen advertised on TV”
         - Michael Pollan, author of "In Defense of Food"

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.