Giter Site home page Giter Site logo

Comments (5)

cristgal avatar cristgal commented on June 30, 2024 1

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'

from python-ipmi.

hthiery avatar hthiery commented on June 30, 2024

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.

from python-ipmi.

cristgal avatar cristgal commented on June 30, 2024

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

from python-ipmi.

cristgal avatar cristgal commented on June 30, 2024

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

from python-ipmi.

hthiery avatar hthiery commented on June 30, 2024

What version of python-ipmi are you using?

from python-ipmi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.