Page 1 of 1
var lock mrtg goes missing
Posted: Fri Jul 21, 2017 10:32 am
by BradZynda
Not sure if
2017-07-21 15:25:01: ERROR: Creating templock /var/lock/mrtg/mrtg_l_5366: No such file or directory at /usr/bin/mrtg line 1961.
is an mrtg error or lock management issue but could something be put in somewhere that does:
if [ ! -d "/var/lock/mrtg" ]; then
mkdir /var/lock/mrtg
fi
What would be the best place?
-Brad
Re: var lock mrtg goes missing
Posted: Fri Jul 21, 2017 4:01 pm
by dwhitfield
Did you import mrtg files from another server? If so, take a look at
https://support.nagios.com/forum/viewto ... =10#p23188
Either way, what's the output of the following:
Code: Select all
LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
Re: var lock mrtg goes missing
Posted: Thu Jul 27, 2017 12:52 pm
by BradZynda
It does not return anything..
but in order to fix it we changed:
/etc/cron.d/mrtg
From:
*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
To:
*/5 * * * * root if [ ! -d /var/lock/mrtg ]; then mkdir /var/lock/mrtg; fi && if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; then env LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok ; fi
Re: var lock mrtg goes missing
Posted: Thu Jul 27, 2017 1:06 pm
by dwhitfield
BradZynda wrote:
but in order to fix it we changed:
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Re: var lock mrtg goes missing
Posted: Fri Jul 28, 2017 12:01 pm
by BradZynda
yep, please close