Page 1 of 1

how to improve the graph update time by modify MRTG

Posted: Mon Jan 26, 2015 3:58 pm
by lisashan
Hi,

the situation si:
i am monitoring a router's interface now, and from the device prospect, i set the update period as 1 minutes, However, the actual update time is much longer than 1min(usually after 5 mins, i can see the update from the chart/flow table, gauge). This performance is not acceptable. Could you kindly give me some advise?

i pasted the email between me and Nagios support here (they recommend me to change the configrue of MRTG ):
Hi Lisa,

Ultimately, true 'real-time' monitoring and graphing is out of scope for Nagios XI- it can check things every minute, but second-by-second updates are not possible.

The lowest check interval you can define is a check every 1 minute, as you saw. This means that a check is being run every minute, but not necessarily that everything will update instantly. It takes some time for the data to be collected, formatted, and rendered to the graphs. In the case of bandwidth specifically, this uses MRTG to provide the graphs, and MRTG is pre-set to update every 5 minutes (thus the delay you've seen). Other items (such as CPU load, for instance) will update much quicker.

It may be possible to modify MRTG to update more often, but this will impact load on your Nagios server. That, coupled with the fact that SNMP checks are fairly resource intensive, and the 1 minute interval you've defined, will largely reduce the number of total checks you'll be able to get from your XI servers.

For help with (possibly) modifying the update interval for MRTG, feel free to post to the forum so the techs can help you explore the option.

Let me know how else we can help!

Best Regards,

Shamas Demoret
Sales Tech
___
Nagios Enterprises, LLC
Office: (888)624-4671
International: +1 651 204 9102
Lisa Shan
Mon 1/26/2015 12:00 PM
Hi Shamas,

Thanks for your last update,

i have another problem here:

i am monitoring a router's interface now, and from the control panel, the minimum update period is 1 minutes, However, the actual update time is much longer than 1min(usually after 5 mins, i can see the update from the chart/flow table). This performance is not acceptable. Could you kindly give me some advise?


now i use my own code to retrieve the data change, i can easily achieve a less then 1 minute update performance.

Your price is really attractive compared with SolarWind, but my supervisor is not satisfied with the performance,i do hope there is a way to improve it.


Thanks,
Lisa

Re: how to improve the graph update time by modify MRTG

Posted: Mon Jan 26, 2015 4:03 pm
by tmcdonald
I spoke with Shamas not too long ago. What he has mentioned in the email about MRTG running on a 5-minute interval is correct. While it is possible to set this to a 1-minute interval to mach the check interval of the services, this will of course increase the MRTG load 5x as well. If you want to do this, you can edit the crontab file: /etc/cron.d/mrtg

Change the first "5" to "1" like so:

Code: Select all

*/1 * * * * 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
then save and run "service crond restart".

Re: how to improve the graph update time by modify MRTG

Posted: Tue Jan 27, 2015 10:12 am
by lisashan
tmcdonald wrote:I spoke with Shamas not too long ago. What he has mentioned in the email about MRTG running on a 5-minute interval is correct. While it is possible to set this to a 1-minute interval to mach the check interval of the services, this will of course increase the MRTG load 5x as well. If you want to do this, you can edit the crontab file: /etc/cron.d/mrtg

Change the first "5" to "1" like so:

Code: Select all

*/1 * * * * 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
then save and run "service crond restart".


Hi tmcdonald,


Thanks for your update, i have modified it already. But the update time i can see is still very slow, much longer than 1 mins and i dont see obvious improvement.

Is there a way to monitor packet per second instead of bit/byte per second? using snmp retriveing pps should be very easy and fast, i think there might be some calculation you did converting pps to bps, which i dont need.

Thanks in advance,
Lisa

Re: how to improve the graph update time by modify MRTG

Posted: Tue Jan 27, 2015 5:21 pm
by tgriep
Could you post one of the configuration settings for your interface checks for review?

Re: how to improve the graph update time by modify MRTG

Posted: Wed Jan 28, 2015 10:17 am
by lisashan
Hi All,

i am posting the configuration here:

1. i add this device through monitor wizard, network switch/router, this is a snmp device with version 2c

2. this is the configuration setting from core config manager:

$USER1$/check_rrdtraf -f /var/lib/mrtg/$ARG1$ -w $ARG2$ -c $ARG3$ -l $ARG4$

ARG1: 172.30.253.101_4.rrd
ARG2: 500,500
ARG3: 900,900
ARG4: K

check interval 1min
retry interval 1min


Thanks in advance,
Lisa

Re: how to improve the graph update time by modify MRTG

Posted: Wed Jan 28, 2015 2:31 pm
by scottwilkerson
Lisa,

We don't have a wizard to monitor packets directly, however it would be possible to poll any OID you specify using the SNMP wizard, or the SNMP Walk wizard.

Re: how to improve the graph update time by modify MRTG

Posted: Thu Jan 29, 2015 3:39 pm
by lisashan
Hi,


my initial prospect is just to INCREASE the graph update period.

i have modified the mrtg crontab value to 1 min, which didnt help much.

i did some research about mrtg, it seems that it is not that simple, i need to configure RRD tool for this purpose.

could anybody give me some advise?

Thanks,
Lisa

Re: how to improve the graph update time by modify MRTG

Posted: Thu Jan 29, 2015 4:39 pm
by scottwilkerson
You would need to add the following to /etc/mrtg.cfg where 1 is the interval in minutes

Code: Select all

Interval: 1
http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html

AND, you will need to remove the the current RRD file in /var/lib/mrtg

AND, you will need to make sure the bandwidth checks for these interfaces (normally setup with the wizard) are also set to check every 1 minute instead of 5 minutes