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

fix(inputs.upsd): handle battery.runtime as float value #13412

Merged
merged 2 commits into from
Jun 9, 2023

Conversation

danclough
Copy link
Contributor

Required for all PRs

In the upsd input plugin, fixed handling of battery.runtime value to account for possible float values. Some UPS systems (APC SmartUPS) may present battery.runtime as a float value like 1000.00, which causes the int64 casting in the plugin to fail.

This merge request reads the battery.runtime value as a float64, multiplies it to nanoseconds, and then casts the result back to int64 to remain compatible with the previous implementation.

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jun 9, 2023

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jun 9, 2023
@danclough
Copy link
Contributor Author

!signed-cla

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix @danclough!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jun 9, 2023
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@powersj powersj merged commit 037eb2f into influxdata:master Jun 9, 2023
@srebhan srebhan added this to the v1.27.0 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants