|
I'm adding a special FAQ for this one since it is asked for so often.
In short, you can't do it, and it is not possible to add it without making serious changes to the log files and still not having full functionality.
The long answer is a bit more complicated.
The RRD files, where the logged data are stored, are 'round robin' databases (hence the name). This means that they summarise the data over specified intervals, and then expire it. The default .rrd definition will keep the 5-min data for just over a day, then the 30-min summaries for a week, the 1-hour summaries for a month, and the 1-day summaries for a year (actually, for 400 intervals, but thats approximately right).
This means that, after a couple of days, you no longer have this 5-min data. If you asked for a graph for last Tuesday (for example) it would be a bit chunky since it would render in 30-min increments, not in 5-min onces. If you asked for a day 6 months ago, it would just show as one big chunk! In addition to this, the required code for the axis labelling etc if you had a user-specified interval would be nasty.
There does exists the 'extendedtime' option, and the rrdextend.pl script, which will double (to 800) the number of datapoints. This will give you 'yesterday' and 'last week' graphs as well, butthe problem will still exist at later times and you must manually extend the RRD after it is created. If you forget then you will have chunky graphs again.
Usually, when people ask for this, they are under the impression that MRTG collects data and stores it indefinitely withut expiry, thus allowing them to call on it at any point in the future. This is because they have not yet noticed how small (and of constant size) the .rrd files are. Note that the .log files work in a similar fashion.
Hope this helps, and explains why this feature - whilest desireable - cannot be added to routers2.cgi without massive amounts of error-checking code, and great complexity (slowing the whole application down).
Steve
|