Y Axis changes with view

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
HuckleberryFinn
Posts: 3
Joined: Fri Feb 09, 2018 7:28 am

Y Axis changes with view

Post by HuckleberryFinn »

Hello, I'm trying to monitor bandwidth usage and I'm very close to having my solution.

I have a graph which will use the Octet count to calculate the bandwidth used in a 30 second period.
The CDEF I've created is the following.

Code: Select all

cdef=CURRENT_DATA_SOURCE,PREV(CURRENT_DATA_SOURCE),-,30,/,8,*,1048576,/
It works as expected, until I change the preset in the preview view to any value above 4 hours. It will then make the Y-Axis greater in value, and this keeps increasing the longer a time span I view it in.

I'm really struggling to figure out how this is caused. I feel it's related to me using the PREV(CURRENT_DATA_SOURCE) value, but can't figure out how to achieve what I need without using it. As well I can't see why 4 hours seems to be the magic break point.

Any help is greatly appreciated.
Thanks
HuckleberryFinn
Posts: 3
Joined: Fri Feb 09, 2018 7:28 am

Re: Y Axis changes with view

Post by HuckleberryFinn »

Has anyone experienced what I'm talking about here?
I feel I can't be the only one...

Happy to clarify anything if it's unclear.
tertius
Cacti User
Posts: 82
Joined: Wed Mar 01, 2017 2:34 pm

Re: Y Axis changes with view

Post by tertius »

HuckleberryFinn wrote: I have a graph which will use the Octet count to calculate the bandwidth used in a 30 second period.
The CDEF I've created is the following.

Code: Select all

cdef=CURRENT_DATA_SOURCE,PREV(CURRENT_DATA_SOURCE),-,30,/,8,*,1048576,/
(((CURRENT_DATA_SOURCE - PREV(CURRENT_DATA_SOURCE)) / 30) * 8) / 1048576

You build the difference between the current and previous data point and divide that by 30. There is no relation of this 30 to seconds or to the step width from point to point. There is a STEPWIDTH function, with which you can compute a value that depends on the distance of the data points. Use this instead of the hardcoded 30.
See https://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html
HuckleberryFinn
Posts: 3
Joined: Fri Feb 09, 2018 7:28 am

Re: Y Axis changes with view

Post by HuckleberryFinn »

Ah that makes sense, thank you for that!

NOTE: I had to compile RRDTool from source as version 1.3.8 is the latest that comes with CentOS, and STEPWIDTH is not included in that version. Seems STEPWIDTH was included after version 1.5.4 (https://github.com/oetiker/rrdtool-1.x/releases)

I'm now having another slight issue, and that's when I adjust the graph the points become more flat, can't find the words to explain (please see the attached).
Attachments
2.png
2.png (107.34 KiB) Viewed 365 times
1.png
1.png (84.33 KiB) Viewed 365 times
tertius
Cacti User
Posts: 82
Joined: Wed Mar 01, 2017 2:34 pm

Re: Y Axis changes with view

Post by tertius »

I don't know what is happening there, but as far as I see it, it could be that you are trying to use cacti+rrdtool in some unintended way. The right way to visualize bandwidth of some network interface is to use one of the "Interface - Traffic" templates, which don't record the absolute value of octet counts of bytes transferred (GAUGE type of rrdtool) but the difference between the current and the last value (COUNTER). You seem to have hand-crafted a data source with GAUGE type and try to compute the change from point to point manually. But this is the power of rrdtool: by using COUNTER, it does this diffing automatically.

If you want to visualize a 30-second average of bandwidth, use a COUNTER RRA with a step of 30. Most easily you do this by creating a 30-second-polling Data Profile (with a poller interval of 30). Then create a new graph and data source by using the predefined "Interface - Traffic" graph template and associate it with the 30-second polling profile instead of the default 5-minute profile.

30-second-polling Data Profile for example like this:
Image

By using this profile, you'll get 24 hours of 30 Seconds resolution, and earlier data is consolidated to longer intervals according to the RRA definitions in that profile. If you want more than 24 hours of 30 seconds resolution, increase the number of rows in the first RRA accordingly.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests