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

Not able to established session #62

Open
paragshagun opened this issue Apr 1, 2019 · 4 comments
Open

Not able to established session #62

paragshagun opened this issue Apr 1, 2019 · 4 comments

Comments

@paragshagun
Copy link

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

@hthiery
Copy link
Contributor

hthiery commented May 9, 2019

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

@karolg58
Copy link

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'

@hthiery
Copy link
Contributor

hthiery commented Dec 27, 2019

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

@coolcoolkg21
Copy link

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.

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

4 participants