Page 1 of 1

mrtg cron job

Posted: Wed Nov 29, 2017 10:41 am
by kendallchenoweth
We have a cron job on NagiosXI that is producing this error.

Code: Select all

root@nagios-aws-us-qa /etc/cron.d$ /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work properly when the environment
       variable LANG is set to UTF-8. Please run mrtg in an environment
       where this is not the case. Try the following command to start:

       env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok 
We're not using Nagios to monitor a network device using mrtg. Do we need this cron job?

Thanks!

Re: mrtg cron job

Posted: Wed Nov 29, 2017 2:42 pm
by kyang
The command you posted doesn't look right. In the /etc/cron.d/mrtg file it should be

Code: Select all

*/5 * * * * root LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lib/mrtg/mrtg.lock --confcache-file /var/lib/mrtg/mrtg.ok
Replace the one you have with the one I posted above.

You should keep the cron in there in case you ever do decide to run the switch wizard and use mrtg. Just so it doesn't create more issues for you.

Let us know if that clears the error.