Skip to content

Update hp_proliant_da_phydrv.py - don't convert disk size to bytes #803

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

Closed
wants to merge 1 commit into from

Conversation

countingpine
Copy link

Fix size reporting on ProLiant Disks - the value is output with the "MB" unit, and doesn't need converting to bytes.

Thank you for your interest in contributing to Checkmk!
Consider looking into Readme regarding process details.

General information

In checking a ProLiant iLO disk information, the size is output as MB, e.g.

Bay: 1, Bus number: 0, Status: ok, Smart status: ok, Ref hours: 24564, Size: 600126259200MB, Condition: ok

But this value is suspiciously large.

The size value is specified to be in megabytes (1,048,576), so the unit is correct.
https://oidref.com/1.3.6.1.4.1.232.3.2.5.1.1.45

But it's mistakenly being converted from MiB to bytes before it is output (size=int(size) * 1024**2).

With this fix it outputs the more reasonable value: 572325MB (~558.9 GB):

Bay: 1, Bus number: 0, Status: ok, Smart status: ok, Ref hours: 24565, Size: 572325MB, Condition: ok

Attaching an SNMP Walk for 1.3.6.1.4.1.232.3.2.5.1.1. on the server (with serial numbers truncated.)
snmpwalk_v2c_cpublic_.1.3.6.1.4.1.232.3.2.5.1.1.txt

OMD - Open Monitoring Distribution Version 2.3.0p26.cre
Running on Ubuntu 24.04.1 LTS

Bug reports

Please include:

  • Your operating system name and version
  • Any details about your local setup that might be helpful in troubleshooting
  • Detailed steps to reproduce the bug
  • An agent output or SNMP walk
  • The ID of a submitted crash report for reference (if applicable)

Proposed changes

Sometimes it is hard for us to assess the quality of a fix.
While it may work for you, it is our job to ensure that it works for everybody.
These are some ways to help us:

  • What is the expected behavior?
  • What is the observed behavior?
  • If it's not obvious from the above: In what way does your patch change the current behavior?
  • Consider writing a unit test that would have failed without your fix.
  • Is this a new problem? What made you submit this PR (new firmware, new device, changed device behavior)?

Fix size reporting on ProLiant Disks - the value is output with the "MB" unit, and doesn't need converting to bytes.
Copy link

github-actions bot commented Mar 11, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@countingpine
Copy link
Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

@countingpine
Copy link
Author

Note, I think this is the same change that was proposed in #660 (which wasn't rejected but closed for other reasons).

@englertor englertor added tracked and removed tracked labels Apr 8, 2025
@CheckmkCI CheckmkCI closed this in 07948d6 May 6, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 6, 2025
CheckmkCI pushed a commit that referenced this pull request May 19, 2025
Fix size unit reporting on ProLiant Disks - the output value was
reported as MB while it was bytes.

Change-Id: I541034368b60d8fb0fbf4a8a9d36e8bb99503566
closes: #803
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants