python-ipmi icon indicating copy to clipboard operation
python-ipmi copied to clipboard

Not able to established session

Open paragshagun opened this issue 6 years ago • 4 comments

import pyipmi import pyipmi.interfaces

interface = pyipmi.interfaces.create_interface(interface='ipmitool', interface_type='lanplus') ipmi = pyipmi.create_connection(interface) ipmi.session.set_session_type_rmcp('10.20.100.40', port=623) ipmi.session.set_auth_type_user('admin', 'admin') ipmi.target = pyipmi.Target(ipmb_address=0x82, routing=[(0x81,0x20,0),(0x20,0x82,7)]) ipmi.session.establish() device_id = ipmi.get_device_id()

Response : Traceback (most recent call last): File "ipmitool.py", line 13, in device_id = ipmi.get_device_id() File "/usr/lib/python2.7/site-packages/pyipmi/bmc.py", line 25, in get_device_id return DeviceId(self.send_message_with_name('GetDeviceId')) 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 145, in send_and_receive req_data.tostring()) File "/usr/lib/python2.7/site-packages/pyipmi/interfaces/ipmitool.py", line 117, in send_and_receive_raw raise RuntimeError('ipmitool failed with rc=%d' % rc) RuntimeError: ipmitool failed with rc=1

paragshagun avatar Apr 01 '19 11:04 paragshagun

what kind of device you try to connect?

in your snippet you have configured a double bridged target like we use for AMCs in ATCA carriers

if you want to connect to normal BMC dont use the ipmi.target line

hthiery avatar May 09 '19 19:05 hthiery

Without a target I get result:

File "/usr/local/lib/python3.7/site-packages/pyipmi/interfaces/ipmitool.py", line 147, in send_and_receive req_data.tostring()) File "/usr/local/lib/python3.7/site-packages/pyipmi/interfaces/ipmitool.py", line 96, in send_and_receive_raw cmd = self._build_ipmitool_cmd(target, lun, netfn, raw_bytes) File "/usr/local/lib/python3.7/site-packages/pyipmi/interfaces/ipmitool.py", line 205, in _build_ipmitool_cmd cmd += self._build_ipmitool_target(target) File "/usr/local/lib/python3.7/site-packages/pyipmi/interfaces/ipmitool.py", line 165, in _build_ipmitool_target if target.routing is not None: AttributeError: 'NoneType' object has no attribute 'routing'

karolg58 avatar Dec 23 '19 14:12 karolg58

what kind of ipmi target do you use?

please take a look into the example: https://github.com/kontron/python-ipmi/blob/master/examples/dcmi.py

hthiery avatar Dec 27 '19 13:12 hthiery

I'm running into the same situation. Can somebody help me out? I've tried changing the ipmp address to 0x20 and editing the routing to the value specified in this tutorial, but still cannot work.

coolcoolkg21 avatar Sep 19 '22 03:09 coolcoolkg21