> It actually turned out to me much easier with plain MRTG. > > Target[foo]: [EMAIL PROTECTED] * 100 / link's maxbytes > # link / maxbytes * 100 won't work probably due to integer division
Of course this works as well, but you have to remember that the values stores in the database will now be percentages whereas the other way, you store the actual traffic (so you can see the data displayed in either way). Also, if you autogenerate your .cfg files, then the first way you just need to add a '--global routers.cgi*Options[^]:aspercent' to the cfgmaker directive whereas the second way you will need to edit the cfgmaker script or use a template. Having the calculation done on the Target line will run the calculation *before* storing in the .log or .rrd file. A Factor[] line, or the various routers2 options, are performed at display time. As you mention, this can cause problems with .log files as they do not handle non-integers very well. Which way you use really depends on your requirements - both give you different benefits and disadvantages. We try here - as far as possible - to store the 'raw' data and display it 'cooked', so in the future we can change the cooking recipe if required... One time when the Target[] line is the best location for the calculation is if the MaxBytes changes regularly, such as disk space usage (when you might increase disk space). However, in this case, routers2 supports 'dorelpercent' which displays 'in' as a percentage of 'out', so we store the disk size in 'out' and the disk usage in 'in' and it still works. Steve _______________________________________________ mrtg mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
