[rrd-users] rrdtool doesn't detect integer overflow

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Aug 22 12:44:48 CEST 2007


On Wed, Aug 22, 2007 at 12:54:00PM +0400, Oleg Derevenetz wrote:

> But is there any way to say rrdupdate that there is no wrap ? For example, if I getting counters from network device interface, and 
> I really know that device was rebooted recently, is there any way to say rrdupdate that only THIS counter value should not be 
> wrapped, but all subsequent values should be wrapped when necessary ?

What do you know?

1: you know the most recent update (this is already in RRDtool)
2: you know a reboot has occured
3: you know the counter starts at zero when a reboot occurs

In step 2, you probably also know (or can know) the exact time when
this reboot occured.

What do you NOT know?

1: the interval between the most recent update and the reboot
2: the countervalue at time of reboot
3: as a result of 1 and 2: the resulting rate is unknown

if you do not know the exact time of the reboot:
4: the interval between the reboot and the first regular update
5: as a result, you can't compute a rate and neither can RRDtool

So, there are two distinct cases:

a) you do know the exact reboot time
b) you don't


Some variables to be able to talk:
n   countervalue at first poll after reboot
Tf  time of first poll after reboot
Tl  time of last poll before reboot
Tr  time of reset

In case (a):
Update your database at time Tr-1 with value U
Update your database at time Tr with value 0
Update your database at time Tf with value n

Result:
Time Tl to Tr has an unknown rate.
Time Tr to Tf has a known rate of n/Tf

In case (b):
Update your database at time Tf-1 with value U
Update your database at time Tf with value n

Result:
Time Tl to Tr has an unknown rate.
Time Tr to Tf has an unknown rate as well.

HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list