[rrd-users] Can i get the <last_ds> value?

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Thu Oct 1 12:23:12 CEST 2009


----- Original Message ----- 
From: "Jayashree" <jayashree.nayak09 at gmail.com>
To: <rrd-users at lists.oetiker.ch>
Sent: Thursday, October 01, 2009 12:03 PM
Subject: [rrd-users] Can i get the <last_ds> value?


> Hi,
>
> I am interested in getting the counter value stored in <last_ds> in the 
> rrd
> file. Any rrd function which can help me?
>
>
> The idea is, i dont have response from the router at a certain point and I
> want to log a zero in my graph. So to achieve this, I am trying to get the
> last counter value stored in <last_ds> in my rrd file.  If there is a 
> better
> way to handle this problem of updating my rrd file with a '0' when i dont
> have response from the device, please let me know.


If you would do that, and if your router would continue working, then at the 
next update you will have all of the traffic in the next update interval. Is 
that really what you want?

Example:

12:00  counter value = 100,000
12:05  counter value = 100,300. The difference is 300 bytes in 300 seconds = 
1 byte per second.
12:10  no response. You update with 100,300. The difference is 0 bytes in 
300 seconds = 0 bytes per second.
12:15  counter value = 100,900. The difference is 600 bytes in 300 seconds = 
2 bytes per second.
12:20  counter value = 101,200. The difference is 300 bytes in 300 seconds = 
1 byte per second.

Four intervals of 5 minutes become: 1, 0, 2 and 1 bytes per second.

You can set heartbeat to (some value just over) 600 seconds and do not 
update. Then the example becomes:

12:00  counter value = 100,000
12:05  counter value = 100,300. The difference is 300 bytes in 300 seconds = 
1 byte per second.
12:10  no response. You do not update.
12:15  counter value = 100,900. The difference is 600 bytes in 600 seconds = 
1 byte per second.
12:20  counter value = 101,200. The difference is 300 bytes in 300 seconds = 
1 byte per second.

Four intervals of 5 minutes become: 1, 1, 1 and 1 bytes per second.


You can also signal that you don't know what happened by inserting an "U" in 
the data:

12:00  counter value = 100,000
12:05  counter value = 100,300. The difference is 300 bytes in 300 seconds = 
1 byte per second.
12:10  no response. You update with "U". The difference is unknown so the 
rate becomes unknown.
12:15  counter value = 100,900. The difference is unknown so the rate 
becomes unknown.
12:20  counter value = 101,200. The difference is 300 bytes in 300 seconds = 
1 byte per second.

Four intervals of 5 minutes become: 1, unknown, unknown, 1 bytes per second


If the unavailability of your router lasts longer than the heartbeat 
interval time, then above is what automatically would happen, even if you do 
update with a known counter value.


HTH
Alex



More information about the rrd-users mailing list