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
var lock mrtg goes missing
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: var lock mrtg goes missing
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:
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.okRe: var lock mrtg goes missing
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
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
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: var lock mrtg goes missing
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!BradZynda wrote: but in order to fix it we changed:
Re: var lock mrtg goes missing
yep, please close