[rrd-users] MRTG-RRD PNG update interval
Jimmy Patel
jimmy at Brocade.com
Thu Aug 20 23:21:56 CEST 2015
Awesome! It's working on the 30sec interval. Thank you very much for your help. Another issue that arose was that noticed that some of my ports for the switches that I am displaying get rearranged after the refresh. Is there any way to stop that?
Thanks,
Jimmy Patel
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: Wednesday, August 19, 2015 6:51 PM
To: Jimmy Patel
Subject: RE: MRTG-RRD PNG update interval
The change you made to .htaccess ensures that the browser will not cache the image for more than 20s. However you also need to make a change to the code as otherwise the Refresh header sent by the routers2.cgi will still specify to refresh every 1min on a 6hour graph.
The change is around line 9738 and you need to alter the line with /6/ in it:
if( $pagetype =~ /graph/ and !$archive and !$archdate ) {
my($rtime) = 1800;
$rtime =900 if($gtype =~ /w/);
$rtime =300 if($gtype =~ /d/);
$rtime = 60 if($gtype =~ /6/);
Set this to 30 instead of 60 to get a 30s refresh on 6h graphs.
Since the statistics work on the nearest available RRA - which will be the 30s RRA - you should end up with the stats representing 30s granularity.
Steve
Steve Shipway
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
(GNU Terry Pratchett)
From: Jimmy Patel [mailto:jimmy at Brocade.com]
Sent: Thursday, 20 August 2015 12:32 p.m.
To: Steve Shipway; rrd-users at lists.oetiker.ch<mailto:rrd-users at lists.oetiker.ch>
Subject: RE: MRTG-RRD PNG update interval
Alright, so updating the graph more frequently than 1 minute will not help visualize the changes. Would it still be possible to see the updated statistics on the text to the right of the graph where it displays the last update, interface name, and MAX, AVG, LAST bps? I changed the .htaccessfile to be M20 where I saw M50 but I do not see those statistics on the right be updated in intervals less than 1 minute. It is only updating after 1 minute. Can that be changed to a finer granularity?
Thank you so much for your help,
Jimmy Patel
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: Wednesday, August 19, 2015 2:55 PM
To: Jimmy Patel
Subject: RE: MRTG-RRD PNG update interval
The 6h graph is based on a 1min interval, so updates every 1min. Of course it will work with a 30s interval, but a 6h time window at 400px results in approximately 1min per pixel...
You can modify the routers2 code to change the refresh interval of the graph; however it is likely that rrdtool rolls uptwo data points to one before graphing and so you wont actually see any changes.
Also, check the .htaccess file in the graphs directory. This will show a 1min timeout for -6- graphs - you can change this to 30s which will avoid the web browser cache holding it for too long.
Steve
Steve Shipway
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
(GNU Terry Pratchett)
From: rrd-users [mailto:rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On Behalf Of Jimmy Patel
Sent: Thursday, 20 August 2015 9:37 a.m.
To: rrd-users at lists.oetiker.ch<mailto:rrd-users at lists.oetiker.ch>
Subject: [rrd-users] FW: MRTG-RRD PNG update interval
Awesome thank you! I finally got the images to show and it the routers2.cgi is looking much better than 14all in my opinion. The issue was due to having incorrect permissions for my webserver to read those files.
I am currently viewing the 6hr graph on Routers2 and it is working fine but it is only updating every 1 minute. My mrtg.cfg file has the interval set at 0:30 for thirty seconds but the cgi is not updating on that interval which was what I was hoping to accomplish. Is there something that I have to change in the routers2.conf file to make the statistics and graphs be updated every 30 seconds rather than one minute for the 6hr graph?
Thank you again,
Jimmy Patel
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: Tuesday, August 18, 2015 4:43 PM
To: Jimmy Patel
Subject: RE: MRTG-RRD PNG update interval
In the routers2.conf, you need to make sure that graphurl=/graphs and graphpath=/var/www/graphs (so that one is the URL and one is the actual filesystem path)
If you are still unable to see the graphs (you get a 'broken image' in the browser) then this will indicate that either the graphs are not being created, or the web server cannot access them.
Since you have confirmed that the graphs do exist in the directory, check the permissions in the web server. Have you granted access to the files in this path? Make sure you do not have htaccess files or other configurations restricting it - maybe you have a stricter web server setup that only grants access to specific locations?
Routers2 has a config test page -- /cgi-bin/routers2.cgi?page=verify -- and this will try to identify common errors.
Also, check if you have SELinux enabled - this can sometimes deny read to certain locations, though in general it really doesn't like RRDTool at all unless you make a lot of settings.
I suspect that the issue with 14all is that it was written when the smallest interval possible with MRTG was 1 minute. Since you are using 0:30 (30s) it may take that as being 30minutes and set the update frequency accordingly.
Steve
Steve Shipway
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
(GNU Terry Pratchett)
From: Jimmy Patel [mailto:jimmy at Brocade.com]
Sent: Wednesday, 19 August 2015 11:25 a.m.
To: Steve Shipway; rrd-users at lists.oetiker.ch<mailto:rrd-users at lists.oetiker.ch>
Subject: RE: MRTG-RRD PNG update interval
Thank you for the response. After testing 14all, I noticed that any interval less than 1min caused the png update to be prolonged. When I keep the 14all graphing interval to be 1min, everything works fine. I would like to get finer intervals so I am now using Routers2.cgi. Unfortunately, I am not able to get the png images of my graphs to show on my browser. I can see the graphs in my /var/www/graphs directory and they are being updated but for some reason these graphs are not showing on the browser. I have checked the routers2.conf file and the graphpath matches the directory. The graphurl is /graphs but if I change it to /var/www/graphs nothing happens. I have also checked the permissions on the .png's and the browser should be able to get the images so I am not quite sure on what the issue is.
Thanks,
Jimmy
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: Monday, August 17, 2015 2:58 PM
To: Jimmy Patel; rrd-users at lists.oetiker.ch<mailto:rrd-users at lists.oetiker.ch>
Subject: RE: MRTG-RRD PNG update interval
The 14all script will normally give you a 'daily' graph, which will have the stats rolled up to 5min intervals, and so will update every 5min. All MRTG-created RRD files support the standard daily(5min), weekly (30min), monthly (2h) and yearly(1d) RRA granularities, though you can set the interval itself lower or higher.
If you want to have the stats at a higher granularity - such as the 30s granularity you have configured your RRD for and are running MRTG at - you will need to customise it.
The Routers2 frontend will spot a shorter interval, and will enable an additional graph called '6 hourly', which uses a 1minute interval. I;ve not tested how RRDTool behaves with a 30s RRD, but RRDTool may well use the 30s interval as this is what is available and so your '6h' graph would have the higher granularity in this case.
If you want to use 14all, you may be forced to modify the code in order to support this more detailed graph, or write custom rrdcgi scripts.
Steve
Steve Shipway
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
(GNU Terry Pratchett)
From: rrd-users [mailto:rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On Behalf Of Jimmy Patel
Sent: Tuesday, 18 August 2015 4:49 a.m.
To: rrd-users at lists.oetiker.ch<mailto:rrd-users at lists.oetiker.ch>
Subject: [rrd-users] MRTG-RRD PNG update interval
Hello, I am using MRTG with RRD tools to view my network statistics. My Interval for MRTG is ":30" and my script is running every 30seconds. I know that my RRD is being updated every 30sec but my statistics on the 14all.cgi are not being updated on that interval. I want the .png graphs to be updated on the interval but it is taking 3-5minutes to show the plots on the graphs. Any help would be tremendous.
Thanks,
Jimmy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20150820/3e61d6b9/attachment-0001.html>
More information about the rrd-users
mailing list