Open cristgal opened 3 years ago
Hi,
take a look into the example https://github.com/kontron/python-ipmi/blob/master/examples/dcmi.py.
You have to set a proper target.
Thanks, I added the target, now I'm getting something different:
#!/bin/env python
import pyipmi
import pyipmi.interfaces
def main():
interface = pyipmi.interfaces.create_interface('ipmitool',
interface_type='lanplus')
ipmi = pyipmi.create_connection(interface)
ipmi.session.set_session_type_rmcp('10.8.1.18', port=623)
ipmi.session.set_auth_type_user('root', 'pass')
ipmi.session.establish()
ipmi.target = pyipmi.Target(ipmb_address=0x20)
fru = ipmi.get_fru_inventory(0)
ipmi.session.close()
if __name__ == "__main__":
main()
Error:
File "./ipmi11.py", line 19, in <module>
main()
File "./ipmi11.py", line 14, in main
fru = ipmi.get_fru_inventory()
File "/usr/lib/python2.7/site-packages/pyipmi/fru.py", line 88, in get_fru_inventory
return FruInventory(self.read_fru_data(fru_id=fru_id))
File "/usr/lib/python2.7/site-packages/pyipmi/fru.py", line 58, in read_fru_data
area_size = self.get_fru_inventory_area_info(fru_id)
File "/usr/lib/python2.7/site-packages/pyipmi/fru.py", line 35, in get_fru_inventory_area_info
fru_id=fru_id)
File "/usr/lib/python2.7/site-packages/pyipmi/__init__.py", line 206, in send_message_with_name
rsp = self.send_message(req)
File "/usr/lib/python2.7/site-packages/pyipmi/__init__.py", line 190, in send_message
rsp = self.interface.send_and_receive(req)
File "/usr/lib/python2.7/site-packages/pyipmi/interfaces/ipmitool.py", line 147, in send_and_receive
req_data.tostring())
File "/usr/lib/python2.7/site-packages/pyipmi/interfaces/ipmitool.py", line 119, in send_and_receive_raw
raise RuntimeError('ipmitool failed with rc=%d' % rc)
RuntimeError: ipmitool failed with rc=127
Heiko @hthiery I literally copy&pasted the script you referenced, and I get the same rc=127, on centos7/py2.7&py3.6 and centos8stream/py3.8, ubuntu2004/py3.8. Thanks.
Traceback (most recent call last):
File "./dcmi.py", line 47, in <module>
main()
File "./dcmi.py", line 28, in main
caps = ipmi.get_dcmi_capabilities(selector)
File "/usr/local/lib/python3.8/site-packages/pyipmi/dcmi.py", line 30, in get_dcmi_capabilities
rsp = self.send_message_with_name('GetDcmiCapabilities',
File "/usr/local/lib/python3.8/site-packages/pyipmi/__init__.py", line 206, in send_message_with_name
rsp = self.send_message(req)
File "/usr/local/lib/python3.8/site-packages/pyipmi/__init__.py", line 190, in send_message
rsp = self.interface.send_and_receive(req)
File "/usr/local/lib/python3.8/site-packages/pyipmi/interfaces/ipmitool.py", line 146, in send_and_receive
rsp_data = self.send_and_receive_raw(req.target, req.lun, req.netfn,
File "/usr/local/lib/python3.8/site-packages/pyipmi/interfaces/ipmitool.py", line 119, in send_and_receive_raw
raise RuntimeError('ipmitool failed with rc=%d' % rc)
RuntimeError: ipmitool failed with rc=127
now I got a different error:
Traceback (most recent call last):
File "./fru.py", line 32, in <module>
main()
File "./fru.py", line 28, in main
fru = ipmi.get_fru_inventory(0)
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 88, in get_fru_inventory
return FruInventory(self.read_fru_data(fru_id=fru_id))
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 391, in __init__
self._from_data(data)
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 402, in _from_data
self.board_info_area = InventoryBoardInfoArea(
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 158, in __init__
self._from_data(data)
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 230, in _from_data
self.manufacturer = FruDataField(data, offset)
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 114, in __init__
self._from_data(data, offset, force_lang_english)
File "/usr/local/lib/python3.8/site-packages/pyipmi/fru.py", line 133, in _from_data
self.value = chr_data.decode('6bitascii')
AttributeError: 'str' object has no attribute 'decode'
What version of python-ipmi are you using?
Hello Guys, anyone would know what am I doing wrong?
Here's one of my servers:
Trying to deal with FRU in a script:
but I get this error:
Ideas? Thanks!