Page 1 of 1

mrtg.cfg unable to complete in 5 minutes

Posted: Mon Aug 17, 2015 2:05 pm
by zaji_nms
Dear Expert

We checked and found /etc/mrtg/mrtg.cfg unable to complete/process in 5 minutes, we want to edit cron.d in 9 minutes as below. Please let us know will it affect the value in graph? Assume one of link utilization is 100Mbps, when MRTG was 5 minutes interval it was plotting 100Mbps , if we change the interval to 9 minutes, values will remain to 100Mbps or will change to other value?

#*/5 * * * * root LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok --logging /var/log/mrtg.log

*/9 * * * * root LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok --logging /var/log/mrtg.log

Or in other case if our MRTG files is very small and we want to run mrtg in every 2 minutes instead of 5 minutes as completing less than 2 minutes, will it affect the values in graph?

Regards

Re: mrtg.cfg unable to complete in 5 minutes

Posted: Mon Aug 17, 2015 4:12 pm
by ssax
*** Test this in a test environment first and make sure you have good backups/vm snapshots in place before trying it.
Note though, setting the Interval for an rrdtool/mrtg setup will influence the initial creation of the database. If you change the interval later, all existing databases will remain at the resolution they were initially created with.
Taken from the MRTG Reference (http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html)

That means that you will have to get rid of the current RRDs that you have and start fresh. If you are OK with that, continue on.

Here is how you would do it, first you need to get rid of the original RRDs:

Code: Select all

mkdir /store/backups/mrtg_backup
mv /var/lib/mrtg/* /store/backups/mrtg_backup/
Then edit your /etc/cron.d/mrtg file to your new time.

Then edit this file:

Code: Select all

/etc/mrtg/mrtg.cfg
Add this entry:

Code: Select all

Interval: 9
After this code:

Code: Select all

Forks: 4
So it looks like this:

Code: Select all

Forks: 4
Interval: 9