Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #12995] Performance data writer for Graphite : Values without fraction limited to 2147483647 (7FFFFFFF) #4752

Closed
icinga-migration opened this issue Oct 27, 2016 · 2 comments
Labels
area/graphite Metrics to Graphite bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/12995

Created by dav_th on 2016-10-27 15:06:49 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-11-02 07:45:04 +00:00)
Target Version: 2.6.0
Last Update: 2016-11-02 07:45:04 +00:00 (in Redmine)

Icinga Version: 2.3.4
Backport?: Not yet backported
Include in Changelog: 1

Hello,

I'm using Icinga2 with Icingaweb2 (2.3.4) on a RaspberryPi 3 with Graphite for visualization.
I noticed that large performance values are sometimes displayed incorrectly (e.g. available Disk Space or RX/TX Counters) in graphs.

I had a look at the data which Icinga2 sends via the graphwriter module and found out that is not correct.

icinga2....value 2147483647 1477567802
icinga2....crit 2147483647 1477567802
icinga2....warn 2147483647 1477567802
icinga2....max 2147483647 1477567802

However data with a fractional part is transferred and displayed correctly.

I found a section in the source code which I presume leads to this error:

in lib/base/convert.cpp:

    if (fractional == 0)
                   return Convert::ToString(static_cast(val));

If the data has no fractional part, a cast to long is performed which limits the range to (-2147483647 .. 2147483647).
So larger values are exported as the maximum long value.

Attachments

Changesets

2016-11-02 07:42:24 +00:00 by gbeutner f48e99c

Fix integer truncation in Convert::ToString

fixes #12995
@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-11-02 07:43:23 +00:00

  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.6.0

Nice catch. I've updated the cast to use "long long" instead. Can you please try whether that fixes it? :)

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-11-02 07:45:04 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset f48e99c.

@icinga-migration icinga-migration added bug Something isn't working area/graphite Metrics to Graphite labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.6.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphite Metrics to Graphite bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant