[solved] Cacti write 1,933 instead 2 in rrd

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

Moderators: Developers, Moderators

Post Reply
cnomark
Posts: 7
Joined: Wed May 05, 2010 7:53 am

[solved] Cacti write 1,933 instead 2 in rrd

Post by cnomark »

Hello I've got a problem with the storing of the values that Cacti gets.

Cacti gets Values of 2 but stores 1,93333 in the rrd.
How can I correct this?
The values are always integers without decimals like:
0 1 2 3 or 4

Polling intervall is 60 seconds.

I have made RRAs like this:

X-Files Factor: 0
Step 1
Rows 500
Timespan: 14400
With Consolidation Functions MAX.

But with rrdtool dump I get this:

Code: Select all

<!-- 2010-05-17 15:43:00 CEST / 1274103780 --> <row><v> NaN </v></row>
			<!-- 2010-05-17 15:44:00 CEST / 1274103840 --> <row><v> 0,0000000000e+00 </v></row>
			<!-- 2010-05-17 15:45:00 CEST / 1274103900 --> <row><v> 1,9333333333e+00 </v></row>
			<!-- 2010-05-17 15:46:00 CEST / 1274103960 --> <row><v> 1,0166666667e+00 </v></row>
Has anyone an idea?

Thx,
cnomark
Last edited by cnomark on Thu May 20, 2010 8:54 am, edited 1 time in total.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

cnomark
Posts: 7
Joined: Wed May 05, 2010 7:53 am

Post by cnomark »

BSOD2600 wrote:This is an rrdtool thing, no cacti.

http://www.vandenbogaerdt.nl/rrdtool/after_the_fact.php
No, I think not.
Your link does not help. When I understand it correct then is there an discription about the past and the future.

But I have the Problem, that Cacti becomes an Value from the present time and this is always an integer . But in the Database standing an totally other value like the 1,9333.

I beginning the database with zero, cacti becomes the value 2 and in the rrd stands later 1,9333.

Can the problem lie here:
05/19/2010 08:25:02 AM - POLLER: Poller[0] NOTE: Poller Int: '60', Cron Int: '60', Time Since Last: '61', Max Runtime '58', Poller Runs: '1'
As Poller runs Spine.

Thank you,
cnomark
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Depending where you pulled that data out from the rrdtool dump, it's either caused from rrdtool consolidation or rrdtool handling different update intervals.

If you see the script returning "2" back to cacti, yet rrdtool dump shows 1.9333, then this is clearly not a cacti issue.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

If you round that number to two decimal places it's still 2.00. Now about why it's 1.9... and not 2.0, that's because RRDtool stores all guages as floats and not integers, and if Cacti polls off by even a fraction of a second between intervals, you get rounding, even at a 1 minute polling interval.

As BSOD indicated, this is normal behavior. You should truly read up on RRDtool. It is an awsome creature.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
cnomark
Posts: 7
Joined: Wed May 05, 2010 7:53 am

Post by cnomark »

Ok, thank you.
But what can I do now?

Is there an possibility to became the 2 in the rrd?

I have an jpg attached to show you what I meen.
On that screenshot you see that cacti display 1,1 instead 1.
I don't no why. The value that cacti will get is definitely 1.
Attachments
cacti-notone.jpg
cacti-notone.jpg (38.57 KiB) Viewed 2437 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Use the exact number gprint fpr text. You can also use a cdef on the graph value.see www.rrdtool.org for more info on cdefs.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
cnomark
Posts: 7
Joined: Wed May 05, 2010 7:53 am

Post by cnomark »

Thank you for the hint.

I have the problem solved with an very long CDEF from schurzi in this topic:

http://forums.cacti.net/viewtopic.php?p=189821#189821

The CDEF is:

Code: Select all

CURRENT_DATA_SOURCE,CURRENT_DATA_SOURCE,FLOOR,-,0.5,-,CURRENT_DATA_SOURCE,CURRENT_DATA_SOURCE,FLOOR,-,0.5,-,ABS,+,CURRENT_DATA_SOURCE,CEIL,CURRENT_DATA_SOURCE,FLOOR,IF
Now I have roundet Values.

I wonder about this long cdef. I have searched for an function like rnd().

But ok. The main thing is that it work.

Thank you,
cnomark
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Read this page, and see if you can find a good function:

http://oss.oetiker.ch/rrdtool/doc/rrdgraph_rpn.en.html

I just read it and can't believe there is not a "ROUND" function. I'm besides myself. Who want's to tell Tobi?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Tobi will flame you for doing so. This is THE FAQ for rrdtool.
And it's not a issue with rounding, no.
Again, it's consolidation, sigh
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

cnomark wrote:
BSOD2600 wrote:This is an rrdtool thing, no cacti.

http://www.vandenbogaerdt.nl/rrdtool/after_the_fact.php
No, I think not.
Your link does not help. When I understand it correct then is there an discription about the past and the future.

But I have the Problem, that Cacti becomes an Value from the present time and this is always an integer . But in the Database standing an totally other value like the 1,9333.

I beginning the database with zero, cacti becomes the value 2 and in the rrd stands later 1,9333.

Can the problem lie here:
05/19/2010 08:25:02 AM - POLLER: Poller[0] NOTE: Poller Int: '60', Cron Int: '60', Time Since Last: '61', Max Runtime '58', Poller Runs: '1'
As Poller runs Spine.

Thank you,
cnomark
The time of rrdtool update matters. If it occurs on "exact interval boundaries" related to "absolute 0 timestamp", then nothing weird will happen. If it does occure e.g. some few seconds off, it will work this way and there is NO WAY to stop that.
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests