var lock mrtg goes missing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

var lock mrtg goes missing

Post 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
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

Post 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
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

Re: var lock mrtg goes missing

Post 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
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

Post 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!
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

Re: var lock mrtg goes missing

Post by BradZynda »

yep, please close
Locked