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

Got TypeError: unsupported format string passed to bytes.__format__ when listing sensors #90

Open
rpelissi opened this issue Feb 22, 2021 · 0 comments

Comments

@rpelissi
Copy link

rpelissi commented Feb 22, 2021

Hi!
So, I am trying to use the python module to get the health of my system using the sensors. So I have outragously took part of the code in ipmitool to have this sensors and their values. But on a supermicro server, I an error (sometimes it's a timeout, sometimes, an error). When I run the ipmitool, I got this:

$ ipmitool.py -I rmcp -H 10.65.xxx.xx -U ADMIN -P XXXXXX sdr  list
SDR-ID |     | Device String      |
=======|=====|====================|====================
0x0004 |   1 | b'CPU1 Temp'       |      40.0 | 0xc0
0x0047 |   2 | b'CPU2 Temp'       |      42.0 | 0xc0
0x008a |   9 | b'Inlet Temp'      |      22.0 | 0xc0
0x00cd |  11 | b'System Temp'     |      31.0 | 0xc0
0x0110 |  12 | b'Peripheral Temp' |      48.0 | 0xc0
0x0153 |  16 | b'VRMCpu1 Temp'    |      38.0 | 0xc0
0x0196 |  17 | b'VRMCpu2 Temp'    |      37.0 | 0xc0
0x01d9 |  18 | b'VRMSoc1 Temp'    |      45.0 | 0xc0
0x021c |  19 | b'VRMSoc2 Temp'    |      38.0 | 0xc0
0x025f |  20 | b'VRMP1ABCD Temp'  |      41.0 | 0xc0
0x02a2 |  21 | b'VRMP1EFGH Temp'  |      41.0 | 0xc0
0x02e5 |  22 | b'VRMP2ABCD Temp'  |      33.0 | 0xc0
0x0328 |  23 | b'VRMP2EFGH Temp'  |      36.0 | 0xc0
0x036b | 176 | b'P1-DIMMA1 Temp'  |      37.0 | 0xc0
0x03ae | 178 | b'P1-DIMMB1 Temp'  |      37.0 | 0xc0
0x03f1 | 180 | b'P1-DIMMC1 Temp'  |      37.0 | 0xc0
0x0434 | 182 | b'P1-DIMMD1 Temp'  |      36.0 | 0xc0
0x0477 | 184 | b'P1-DIMME1 Temp'  |      34.0 | 0xc0
0x04ba | 186 | b'P1-DIMMF1 Temp'  |      34.0 | 0xc0
0x04fd | 188 | b'P1-DIMMG1 Temp'  |      33.0 | 0xc0
0x0540 | 190 | b'P1-DIMMH1 Temp'  |      33.0 | 0xc0
0x0583 | 208 | b'P2-DIMMA1 Temp'  |      31.0 | 0xc0
0x05c6 | 210 | b'P2-DIMMB1 Temp'  |      31.0 | 0xc0
0x0609 | 212 | b'P2-DIMMC1 Temp'  |      31.0 | 0xc0
0x064c | 214 | b'P2-DIMMD1 Temp'  |      30.0 | 0xc0
0x068f | 216 | b'P2-DIMME1 Temp'  |      34.0 | 0xc0
0x06d2 | 218 | b'P2-DIMMF1 Temp'  |      33.0 | 0xc0
0x0715 | 220 | b'P2-DIMMG1 Temp'  |      33.0 | 0xc0
0x0758 | 222 | b'P2-DIMMH1 Temp'  |      33.0 | 0xc0
0x079b |  65 | b'FAN1'            |    8600.0 | 0xc0
0x07de |  66 | b'FAN2'            |    8700.0 | 0xc0
Traceback (most recent call last):
  File "/home/rpelissi/venv/lib64/python3.6/site-packages/pyipmi/ipmitool.py", line 188, in cmd_sdr_list
    (value, states) = ipmi.get_sensor_reading(s.number)
  File "/home/rpelissi/venv/lib64/python3.6/site-packages/pyipmi/sensor.py", line 164, in get_sensor_reading
    lun=lun)
  File "/home/rpelissi/venv/lib64/python3.6/site-packages/pyipmi/__init__.py", line 207, in send_message_with_name
    check_completion_code(rsp.completion_code)
  File "/home/rpelissi/venv/lib64/python3.6/site-packages/pyipmi/utils.py", line 47, in check_completion_code
    raise CompletionCodeError(cc)
pyipmi.errors.CompletionCodeError: CompletionCodeError cc=0xcb desc=Requested data not present

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rpelissi/venv/bin/ipmitool.py", line 11, in <module>
    load_entry_point('python-ipmi==0.4.2', 'console_scripts', 'ipmitool.py')()
  File "/home/rpelissi/venv/lib64/python3.6/site-packages/pyipmi/ipmitool.py", line 593, in main
    cmd(ipmi, args)
  File "/home/rpelissi/venv/lib64/python3.6/site-packages/pyipmi/ipmitool.py", line 207, in cmd_sdr_list
    e.cc))
TypeError: unsupported format string passed to bytes.__format__

Any idea on how I can debug this? I am not too familiar with ipmi but if I can give you more infos, just let me know!
Thanks again for this code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant