python-ipmi 0.5.8__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. python_ipmi-0.6.0/MANIFEST.in +1 -0
  2. python_ipmi-0.6.0/PKG-INFO +312 -0
  3. python_ipmi-0.6.0/README.md +270 -0
  4. python_ipmi-0.6.0/man/ipmitool.py.1 +1066 -0
  5. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/__init__.py +90 -72
  6. python_ipmi-0.6.0/pyipmi/bmc.py +350 -0
  7. python_ipmi-0.6.0/pyipmi/chassis.py +413 -0
  8. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/constants.py +35 -0
  9. python_ipmi-0.6.0/pyipmi/dcmi.py +394 -0
  10. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/errors.py +34 -22
  11. python_ipmi-0.6.0/pyipmi/event.py +97 -0
  12. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/fields.py +33 -28
  13. python_ipmi-0.6.0/pyipmi/fru.py +1462 -0
  14. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/helper.py +50 -16
  15. python_ipmi-0.6.0/pyipmi/hpm.py +1449 -0
  16. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/interfaces/__init__.py +14 -4
  17. python_ipmi-0.6.0/pyipmi/interfaces/aardvark.py +174 -0
  18. python_ipmi-0.6.0/pyipmi/interfaces/base.py +87 -0
  19. python_ipmi-0.6.0/pyipmi/interfaces/ipmb.py +478 -0
  20. python_ipmi-0.6.0/pyipmi/interfaces/ipmbdev.py +60 -0
  21. python_ipmi-0.6.0/pyipmi/interfaces/ipmidev.py +244 -0
  22. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/interfaces/ipmitool.py +157 -89
  23. python_ipmi-0.6.0/pyipmi/interfaces/mock.py +26 -0
  24. python_ipmi-0.6.0/pyipmi/interfaces/openipmblink.py +312 -0
  25. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/interfaces/rmcp.py +219 -195
  26. python_ipmi-0.6.0/pyipmi/interfaces/rmcpplus.py +570 -0
  27. python_ipmi-0.6.0/pyipmi/interfaces/router.py +242 -0
  28. python_ipmi-0.6.0/pyipmi/ipmitool.py +1442 -0
  29. python_ipmi-0.6.0/pyipmi/lan.py +434 -0
  30. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/logger.py +4 -4
  31. python_ipmi-0.6.0/pyipmi/messaging.py +388 -0
  32. python_ipmi-0.6.0/pyipmi/mixin.py +52 -0
  33. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/__init__.py +0 -1
  34. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/constants.py +98 -0
  35. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/dcmi.py +177 -19
  36. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/device_messaging.py +34 -0
  37. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/fru.py +3 -1
  38. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/hpm.py +7 -7
  39. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/message.py +119 -83
  40. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/picmg.py +7 -5
  41. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/registry.py +18 -9
  42. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/sel.py +4 -4
  43. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/vita.py +0 -1
  44. python_ipmi-0.6.0/pyipmi/picmg.py +942 -0
  45. python_ipmi-0.6.0/pyipmi/sdr.py +1145 -0
  46. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/sel.py +185 -20
  47. python_ipmi-0.6.0/pyipmi/sensor.py +360 -0
  48. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/session.py +58 -34
  49. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/state.py +13 -5
  50. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/utils.py +60 -55
  51. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/version.py +1 -1
  52. python_ipmi-0.6.0/pyipmi/vita.py +281 -0
  53. python_ipmi-0.6.0/python_ipmi.egg-info/PKG-INFO +312 -0
  54. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/python_ipmi.egg-info/SOURCES.txt +17 -3
  55. python_ipmi-0.6.0/python_ipmi.egg-info/requires.txt +3 -0
  56. python_ipmi-0.6.0/setup.cfg +27 -0
  57. python_ipmi-0.6.0/setup.py +124 -0
  58. python_ipmi-0.6.0/tests/test_bmc.py +143 -0
  59. python_ipmi-0.6.0/tests/test_chassis.py +147 -0
  60. python_ipmi-0.6.0/tests/test_constants.py +9 -0
  61. python_ipmi-0.6.0/tests/test_dcmi.py +228 -0
  62. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_device_messaging.py +0 -1
  63. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_errors.py +0 -1
  64. python_ipmi-0.6.0/tests/test_event.py +69 -0
  65. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_fields.py +10 -2
  66. python_ipmi-0.6.0/tests/test_fru.py +804 -0
  67. python_ipmi-0.6.0/tests/test_helper.py +163 -0
  68. python_ipmi-0.6.0/tests/test_hpm.py +740 -0
  69. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_ipmi.py +16 -1
  70. python_ipmi-0.6.0/tests/test_ipmitool.py +701 -0
  71. python_ipmi-0.6.0/tests/test_lan.py +190 -0
  72. python_ipmi-0.6.0/tests/test_messaging.py +99 -0
  73. python_ipmi-0.6.0/tests/test_picmg.py +356 -0
  74. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_sdr.py +129 -7
  75. python_ipmi-0.6.0/tests/test_sel.py +260 -0
  76. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_sensor.py +0 -1
  77. python_ipmi-0.6.0/tests/test_session.py +55 -0
  78. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/tests/test_utils.py +0 -1
  79. python_ipmi-0.6.0/tests/test_vita.py +193 -0
  80. python_ipmi-0.5.8/PKG-INFO +0 -207
  81. python_ipmi-0.5.8/README.rst +0 -170
  82. python_ipmi-0.5.8/pyipmi/bmc.py +0 -181
  83. python_ipmi-0.5.8/pyipmi/chassis.py +0 -269
  84. python_ipmi-0.5.8/pyipmi/dcmi.py +0 -57
  85. python_ipmi-0.5.8/pyipmi/emulation.py +0 -395
  86. python_ipmi-0.5.8/pyipmi/event.py +0 -38
  87. python_ipmi-0.5.8/pyipmi/fru.py +0 -477
  88. python_ipmi-0.5.8/pyipmi/hpm.py +0 -728
  89. python_ipmi-0.5.8/pyipmi/interfaces/aardvark.py +0 -232
  90. python_ipmi-0.5.8/pyipmi/interfaces/ipmb.py +0 -272
  91. python_ipmi-0.5.8/pyipmi/interfaces/ipmbdev.py +0 -176
  92. python_ipmi-0.5.8/pyipmi/interfaces/mock.py +0 -25
  93. python_ipmi-0.5.8/pyipmi/ipmitool.py +0 -757
  94. python_ipmi-0.5.8/pyipmi/lan.py +0 -259
  95. python_ipmi-0.5.8/pyipmi/messaging.py +0 -199
  96. python_ipmi-0.5.8/pyipmi/picmg.py +0 -504
  97. python_ipmi-0.5.8/pyipmi/sdr.py +0 -656
  98. python_ipmi-0.5.8/pyipmi/sensor.py +0 -235
  99. python_ipmi-0.5.8/python_ipmi.egg-info/PKG-INFO +0 -207
  100. python_ipmi-0.5.8/setup.cfg +0 -19
  101. python_ipmi-0.5.8/setup.py +0 -79
  102. python_ipmi-0.5.8/tests/test_bmc.py +0 -57
  103. python_ipmi-0.5.8/tests/test_chassis.py +0 -71
  104. python_ipmi-0.5.8/tests/test_event.py +0 -38
  105. python_ipmi-0.5.8/tests/test_fru.py +0 -96
  106. python_ipmi-0.5.8/tests/test_helper.py +0 -32
  107. python_ipmi-0.5.8/tests/test_hpm.py +0 -94
  108. python_ipmi-0.5.8/tests/test_ipmitool.py +0 -36
  109. python_ipmi-0.5.8/tests/test_lan.py +0 -67
  110. python_ipmi-0.5.8/tests/test_picmg.py +0 -64
  111. python_ipmi-0.5.8/tests/test_sel.py +0 -154
  112. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/AUTHORS +0 -0
  113. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/COPYING +0 -0
  114. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/bmc.py +0 -0
  115. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/chassis.py +0 -0
  116. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/event.py +0 -0
  117. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/lan.py +0 -0
  118. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/sdr.py +0 -0
  119. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/sensor.py +0 -0
  120. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/pyipmi/msgs/session.py +0 -0
  121. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/python_ipmi.egg-info/dependency_links.txt +0 -0
  122. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/python_ipmi.egg-info/entry_points.txt +0 -0
  123. {python_ipmi-0.5.8 → python_ipmi-0.6.0}/python_ipmi.egg-info/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ include man/ipmitool.py.1
@@ -0,0 +1,312 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-ipmi
3
+ Version: 0.6.0
4
+ Summary: Pure python IPMI library
5
+ Home-page: https://github.com/kontron/python-ipmi
6
+ Download-URL: https://github.com/kontron/python-ipmi/tarball/0.6.0
7
+ Author: Michael Walle, Heiko Thiery
8
+ Author-email: michael.walle@kontron.com, heiko.thiery@kontron.com
9
+ License: LGPLv2+
10
+ Platform: any
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
14
+ Classifier: Natural Language :: English
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: COPYING
26
+ License-File: AUTHORS
27
+ Provides-Extra: rmcpplus
28
+ Requires-Dist: cryptography; extra == "rmcpplus"
29
+ Dynamic: author
30
+ Dynamic: author-email
31
+ Dynamic: classifier
32
+ Dynamic: description
33
+ Dynamic: description-content-type
34
+ Dynamic: download-url
35
+ Dynamic: home-page
36
+ Dynamic: license
37
+ Dynamic: license-file
38
+ Dynamic: platform
39
+ Dynamic: provides-extra
40
+ Dynamic: requires-python
41
+ Dynamic: summary
42
+
43
+ # Pure Python IPMI Library
44
+
45
+ [![Build Status](https://github.com/kontron/python-ipmi/actions/workflows/test.yml/badge.svg)](https://github.com/kontron/python-ipmi/actions/workflows/test.yml)
46
+ [![PyPI version](https://badge.fury.io/py/python-ipmi.svg)](http://badge.fury.io/py/python-ipmi)
47
+ [![Documentation Status](https://readthedocs.org/projects/python-ipmi/badge/?version=latest)](https://python-ipmi.readthedocs.io/en/latest/?badge=latest)
48
+ [![Python versions](https://img.shields.io/pypi/pyversions/python-ipmi.svg)](http://badge.fury.io/py/python-ipmi)
49
+ [![Coverage Status](https://coveralls.io/repos/github/kontron/python-ipmi/badge.svg?branch=master)](https://coveralls.io/github/kontron/python-ipmi?branch=master)
50
+ [![Code Climate](https://codeclimate.com/github/kontron/python-ipmi/badges/gpa.svg)](http://codeclimate.com/github/kontron/python-ipmi)
51
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/068eca4b1e784425aa46ae0b06aeaf37)](https://www.codacy.com/gh/kontron/python-ipmi/dashboard?utm_source=github.com&utm_medium=referral&utm_content=kontron/python-ipmi&utm_campaign=Badge_Grade)
52
+
53
+ ## Features
54
+
55
+ * RMCP interface
56
+ * native
57
+ * legacy using [ipmitool] as backend
58
+ * RMCP+ interface
59
+ * native
60
+ * legacy using [ipmitool] as backend
61
+ * system interface (using ipmitool as backend)
62
+ * native (KCS, SMIC, BT, SSIF) using the IPMI driver on Linux
63
+ * legacy using [ipmitool] as backend
64
+ * IPMB interface
65
+ * using the [Total Phase] Aardvark
66
+ * using ipmb-dev driver on Linux
67
+
68
+ ## Tested Devices
69
+
70
+ * Kontron
71
+ * mTCA Carrier Manager
72
+ * CompactPCI boards
73
+ * VPX boards
74
+ * Pigeon Point Shelf Manager
75
+ * HPE iLO3/iLO4
76
+ * N.A.T. NAT-MCH
77
+ * DESY MMC STAMP & related AMCs (DAMC-FMC2ZUP, DAMC-FMC1Z7IO)
78
+ * Supermicro
79
+
80
+ ## Requirements
81
+
82
+ For IPMB interface a [Total Phase] Aardvark is needed.
83
+ Another option is to use ipmb-dev driver on Linux with an I2C bus, driver of which supports slave mode:
84
+ https://www.kernel.org/doc/html/latest/driver-api/ipmb.html
85
+
86
+ For the native system interface the Linux IPMI driver is needed
87
+ (`ipmi_devintf` and e.g. `ipmi_si` or `ipmi_ssif`), which provides
88
+ `/dev/ipmi0`:
89
+ https://www.kernel.org/doc/html/latest/driver-api/ipmi.html
90
+
91
+ For legacy RMCP, RMCP+ and system interface (KCS) using ipmitool as backend
92
+ the installation of ipmitool is required.
93
+
94
+ The native RMCP+ interface needs the [cryptography] package for
95
+ encrypted sessions (AES-CBC-128, cipher suites 3 and 17):
96
+
97
+ ```shell
98
+ pip install python-ipmi[rmcpplus]
99
+ ```
100
+
101
+ ## Installation
102
+
103
+ ### Using `pip`
104
+
105
+ The recommended installation method is using [pip](https://pip.pypa.io):
106
+
107
+ ```shell
108
+ pip install python-ipmi
109
+ ```
110
+
111
+ ### Manual installation
112
+
113
+ Download the source distribution package for the library. Extract the package to
114
+ a temporary location and install:
115
+
116
+ ```shell
117
+ python setup.py install
118
+ ```
119
+
120
+ ### Package version
121
+
122
+ The version of the package is taken from, in this order:
123
+
124
+ 1. `git describe --tags` in a git checkout, e.g. `0.5.8.dev77+g7c853b0`
125
+ for the 77th commit after the tag `0.5.8`
126
+ 2. `pyipmi/version.py`, which is generated by `setup.py` and is part of the
127
+ source distribution on PyPI
128
+ 3. `version_archive.txt`, which `git archive` fills in with the tag. This
129
+ makes the tarballs of the GitHub releases build with the right version,
130
+ e.g. for distribution packages.
131
+
132
+ If none of them is available, the version is `0+unknown`. The installed
133
+ version is available as `pyipmi.__version__` and with `ipmitool.py -V`.
134
+
135
+ ## Documentation
136
+
137
+ You can find the most up to date documentation at:
138
+ http://python-ipmi.rtfd.org
139
+
140
+ ## Example
141
+
142
+ The examples below talk to the BMC of a server, which has the IPMB address
143
+ `0x20`. Set a routing only for targets behind the BMC, see
144
+ [Bridged targets](#bridged-targets).
145
+
146
+ Example with the native RMCP+ interface (IPMI v2.0, like `ipmitool -I lanplus`):
147
+
148
+ ```python
149
+ import pyipmi
150
+ import pyipmi.interfaces
151
+
152
+ # without cipher_suite the cipher suites 17 and 3 are tried
153
+ interface = pyipmi.interfaces.create_interface('rmcpplus', cipher_suite=3)
154
+
155
+ connection = pyipmi.create_connection(interface)
156
+
157
+ connection.target = pyipmi.Target(0x20)
158
+ connection.session.set_session_type_rmcp('10.0.0.1', port=623)
159
+ connection.session.set_auth_type_user('admin', 'admin')
160
+ connection.session.set_priv_level('ADMINISTRATOR')
161
+
162
+ connection.open()
163
+ connection.get_device_id()
164
+ connection.close()
165
+ ```
166
+
167
+ ipmitool command:
168
+
169
+ ```shell
170
+ ipmitool -I lanplus -C 3 -H 10.0.0.1 -p 623 -U admin -P admin -L ADMINISTRATOR -t 0x20 raw 0x06 0x01
171
+ ```
172
+
173
+ Example using the [ipmitool] as backend with the lan interface:
174
+
175
+ ```python
176
+ import pyipmi
177
+ import pyipmi.interfaces
178
+
179
+ # Supported interface_types for ipmitool are: 'lan' , 'lanplus', and 'serial-terminal'
180
+ interface = pyipmi.interfaces.create_interface('ipmitool', interface_type='lan')
181
+
182
+ connection = pyipmi.create_connection(interface)
183
+
184
+ connection.target = pyipmi.Target(0x20)
185
+
186
+ connection.session.set_session_type_rmcp('10.0.0.1', port=623)
187
+ connection.session.set_auth_type_user('admin', 'admin')
188
+ connection.session.set_priv_level("ADMINISTRATOR")
189
+ connection.session.establish()
190
+
191
+ connection.get_device_id()
192
+ ```
193
+
194
+ ipmitool command:
195
+
196
+ ```shell
197
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" raw 0x06 0x01
198
+ ```
199
+
200
+ Example with serial interface:
201
+
202
+ ```python
203
+ import pyipmi
204
+ import pyipmi.interfaces
205
+
206
+ interface = pyipmi.interfaces.create_interface('ipmitool', interface_type='serial-terminal')
207
+
208
+ connection = pyipmi.create_connection(interface)
209
+
210
+ connection.target = pyipmi.Target(0xb2)
211
+
212
+ # set_session_type_serial(port, baudrate)
213
+ connection.session.set_session_type_serial('/dev/tty2', 115200)
214
+ connection.session.establish()
215
+
216
+ connection.get_device_id()
217
+ ```
218
+
219
+ ipmitool command:
220
+
221
+ ```shell
222
+ ipmitool -I serial-terminal -D /dev/tty2:115200 -t 0xb2 -l 0 raw 0x06 0x01
223
+ ```
224
+
225
+ Example with the system interface using the Linux IPMI driver:
226
+
227
+ ```python
228
+ import pyipmi
229
+ import pyipmi.interfaces
230
+
231
+ interface = pyipmi.interfaces.create_interface('ipmidev', port='/dev/ipmi0')
232
+
233
+ connection = pyipmi.create_connection(interface)
234
+
235
+ connection.target = pyipmi.Target(0x20)
236
+
237
+ connection.open()
238
+ connection.get_device_id()
239
+ connection.close()
240
+ ```
241
+
242
+ ipmitool command:
243
+
244
+ ```shell
245
+ ipmitool -I open -t 0x20 raw 0x06 0x01
246
+ ```
247
+
248
+ ### Bridged targets
249
+
250
+ In ATCA and MicroTCA systems the controllers of blades and AMCs are not
251
+ reachable directly but only through the shelf manager or MCH, which forwards
252
+ (bridges) the requests on IPMB. For these targets set the IPMB address of the
253
+ target and the routing to it. A routing is a list of
254
+ `(requester address, responder address, channel)` tuples, one per hop.
255
+
256
+ Example for an ATCA blade with IPMB address `0x82` behind the shelf manager:
257
+
258
+ ```python
259
+ connection.target = pyipmi.Target(0x82)
260
+ connection.target.set_routing([(0x81, 0x20, 0), (0x20, 0x82, None)])
261
+ ```
262
+
263
+ ipmitool command:
264
+
265
+ ```shell
266
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" -t 0x82 -b 0 raw 0x06 0x01
267
+ ```
268
+
269
+ Do not set a routing to talk to the BMC of a server itself, the bridged
270
+ request fails then (e.g. with completion code `0x83`, NAK on write).
271
+
272
+ Some shelf managers and carrier managers do not return the sequence number
273
+ of a bridged request in their response. If requests time out although the
274
+ device answers (the debug log shows `discarding message that does not match
275
+ the request`), create the native interface with
276
+ `quirks_cfg={'rmcp_ignore_rq_seq': True}`. With the ipmitool backend the
277
+ routing needs the bridge channel of every hop except the last one.
278
+ See the [documentation](https://python-ipmi.readthedocs.io/en/latest/quick_start.html)
279
+ for more routing examples.
280
+
281
+ ## Compatibility
282
+
283
+ Python >= 3.10 is currently supported. Python 2.x is deprecated.
284
+
285
+ ## Contributing
286
+
287
+ Contributions are always welcome. You may send patches directly (eg. `git
288
+ send-email`), do a github pull request or just file an issue.
289
+
290
+ * respect the coding style (eg. PEP8),
291
+ * provide well-formed commit message (see [this blog post](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)),
292
+ * add a Signed-off-by line (eg. `git commit -s`)
293
+
294
+ ## License
295
+
296
+ This library is free software; you can redistribute it and/or modify it
297
+ under the terms of the GNU Lesser General Public License as published by
298
+ the Free Software Foundation; either version 2.1 of the License, or (at
299
+ your option) any later version.
300
+
301
+ This library is distributed in the hope that it will be useful, but WITHOUT
302
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
303
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
304
+ License for more details.
305
+
306
+ You should have received a copy of the GNU Lesser General Public License
307
+ along with this library; if not, write to the Free Software Foundation,
308
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
309
+
310
+ [Total Phase]: http://www.totalphase.com
311
+ [ipmitool]: https://codeberg.org/IPMITool/ipmitool
312
+ [cryptography]: https://pypi.org/project/cryptography/
@@ -0,0 +1,270 @@
1
+ # Pure Python IPMI Library
2
+
3
+ [![Build Status](https://github.com/kontron/python-ipmi/actions/workflows/test.yml/badge.svg)](https://github.com/kontron/python-ipmi/actions/workflows/test.yml)
4
+ [![PyPI version](https://badge.fury.io/py/python-ipmi.svg)](http://badge.fury.io/py/python-ipmi)
5
+ [![Documentation Status](https://readthedocs.org/projects/python-ipmi/badge/?version=latest)](https://python-ipmi.readthedocs.io/en/latest/?badge=latest)
6
+ [![Python versions](https://img.shields.io/pypi/pyversions/python-ipmi.svg)](http://badge.fury.io/py/python-ipmi)
7
+ [![Coverage Status](https://coveralls.io/repos/github/kontron/python-ipmi/badge.svg?branch=master)](https://coveralls.io/github/kontron/python-ipmi?branch=master)
8
+ [![Code Climate](https://codeclimate.com/github/kontron/python-ipmi/badges/gpa.svg)](http://codeclimate.com/github/kontron/python-ipmi)
9
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/068eca4b1e784425aa46ae0b06aeaf37)](https://www.codacy.com/gh/kontron/python-ipmi/dashboard?utm_source=github.com&utm_medium=referral&utm_content=kontron/python-ipmi&utm_campaign=Badge_Grade)
10
+
11
+ ## Features
12
+
13
+ * RMCP interface
14
+ * native
15
+ * legacy using [ipmitool] as backend
16
+ * RMCP+ interface
17
+ * native
18
+ * legacy using [ipmitool] as backend
19
+ * system interface (using ipmitool as backend)
20
+ * native (KCS, SMIC, BT, SSIF) using the IPMI driver on Linux
21
+ * legacy using [ipmitool] as backend
22
+ * IPMB interface
23
+ * using the [Total Phase] Aardvark
24
+ * using ipmb-dev driver on Linux
25
+
26
+ ## Tested Devices
27
+
28
+ * Kontron
29
+ * mTCA Carrier Manager
30
+ * CompactPCI boards
31
+ * VPX boards
32
+ * Pigeon Point Shelf Manager
33
+ * HPE iLO3/iLO4
34
+ * N.A.T. NAT-MCH
35
+ * DESY MMC STAMP & related AMCs (DAMC-FMC2ZUP, DAMC-FMC1Z7IO)
36
+ * Supermicro
37
+
38
+ ## Requirements
39
+
40
+ For IPMB interface a [Total Phase] Aardvark is needed.
41
+ Another option is to use ipmb-dev driver on Linux with an I2C bus, driver of which supports slave mode:
42
+ https://www.kernel.org/doc/html/latest/driver-api/ipmb.html
43
+
44
+ For the native system interface the Linux IPMI driver is needed
45
+ (`ipmi_devintf` and e.g. `ipmi_si` or `ipmi_ssif`), which provides
46
+ `/dev/ipmi0`:
47
+ https://www.kernel.org/doc/html/latest/driver-api/ipmi.html
48
+
49
+ For legacy RMCP, RMCP+ and system interface (KCS) using ipmitool as backend
50
+ the installation of ipmitool is required.
51
+
52
+ The native RMCP+ interface needs the [cryptography] package for
53
+ encrypted sessions (AES-CBC-128, cipher suites 3 and 17):
54
+
55
+ ```shell
56
+ pip install python-ipmi[rmcpplus]
57
+ ```
58
+
59
+ ## Installation
60
+
61
+ ### Using `pip`
62
+
63
+ The recommended installation method is using [pip](https://pip.pypa.io):
64
+
65
+ ```shell
66
+ pip install python-ipmi
67
+ ```
68
+
69
+ ### Manual installation
70
+
71
+ Download the source distribution package for the library. Extract the package to
72
+ a temporary location and install:
73
+
74
+ ```shell
75
+ python setup.py install
76
+ ```
77
+
78
+ ### Package version
79
+
80
+ The version of the package is taken from, in this order:
81
+
82
+ 1. `git describe --tags` in a git checkout, e.g. `0.5.8.dev77+g7c853b0`
83
+ for the 77th commit after the tag `0.5.8`
84
+ 2. `pyipmi/version.py`, which is generated by `setup.py` and is part of the
85
+ source distribution on PyPI
86
+ 3. `version_archive.txt`, which `git archive` fills in with the tag. This
87
+ makes the tarballs of the GitHub releases build with the right version,
88
+ e.g. for distribution packages.
89
+
90
+ If none of them is available, the version is `0+unknown`. The installed
91
+ version is available as `pyipmi.__version__` and with `ipmitool.py -V`.
92
+
93
+ ## Documentation
94
+
95
+ You can find the most up to date documentation at:
96
+ http://python-ipmi.rtfd.org
97
+
98
+ ## Example
99
+
100
+ The examples below talk to the BMC of a server, which has the IPMB address
101
+ `0x20`. Set a routing only for targets behind the BMC, see
102
+ [Bridged targets](#bridged-targets).
103
+
104
+ Example with the native RMCP+ interface (IPMI v2.0, like `ipmitool -I lanplus`):
105
+
106
+ ```python
107
+ import pyipmi
108
+ import pyipmi.interfaces
109
+
110
+ # without cipher_suite the cipher suites 17 and 3 are tried
111
+ interface = pyipmi.interfaces.create_interface('rmcpplus', cipher_suite=3)
112
+
113
+ connection = pyipmi.create_connection(interface)
114
+
115
+ connection.target = pyipmi.Target(0x20)
116
+ connection.session.set_session_type_rmcp('10.0.0.1', port=623)
117
+ connection.session.set_auth_type_user('admin', 'admin')
118
+ connection.session.set_priv_level('ADMINISTRATOR')
119
+
120
+ connection.open()
121
+ connection.get_device_id()
122
+ connection.close()
123
+ ```
124
+
125
+ ipmitool command:
126
+
127
+ ```shell
128
+ ipmitool -I lanplus -C 3 -H 10.0.0.1 -p 623 -U admin -P admin -L ADMINISTRATOR -t 0x20 raw 0x06 0x01
129
+ ```
130
+
131
+ Example using the [ipmitool] as backend with the lan interface:
132
+
133
+ ```python
134
+ import pyipmi
135
+ import pyipmi.interfaces
136
+
137
+ # Supported interface_types for ipmitool are: 'lan' , 'lanplus', and 'serial-terminal'
138
+ interface = pyipmi.interfaces.create_interface('ipmitool', interface_type='lan')
139
+
140
+ connection = pyipmi.create_connection(interface)
141
+
142
+ connection.target = pyipmi.Target(0x20)
143
+
144
+ connection.session.set_session_type_rmcp('10.0.0.1', port=623)
145
+ connection.session.set_auth_type_user('admin', 'admin')
146
+ connection.session.set_priv_level("ADMINISTRATOR")
147
+ connection.session.establish()
148
+
149
+ connection.get_device_id()
150
+ ```
151
+
152
+ ipmitool command:
153
+
154
+ ```shell
155
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" raw 0x06 0x01
156
+ ```
157
+
158
+ Example with serial interface:
159
+
160
+ ```python
161
+ import pyipmi
162
+ import pyipmi.interfaces
163
+
164
+ interface = pyipmi.interfaces.create_interface('ipmitool', interface_type='serial-terminal')
165
+
166
+ connection = pyipmi.create_connection(interface)
167
+
168
+ connection.target = pyipmi.Target(0xb2)
169
+
170
+ # set_session_type_serial(port, baudrate)
171
+ connection.session.set_session_type_serial('/dev/tty2', 115200)
172
+ connection.session.establish()
173
+
174
+ connection.get_device_id()
175
+ ```
176
+
177
+ ipmitool command:
178
+
179
+ ```shell
180
+ ipmitool -I serial-terminal -D /dev/tty2:115200 -t 0xb2 -l 0 raw 0x06 0x01
181
+ ```
182
+
183
+ Example with the system interface using the Linux IPMI driver:
184
+
185
+ ```python
186
+ import pyipmi
187
+ import pyipmi.interfaces
188
+
189
+ interface = pyipmi.interfaces.create_interface('ipmidev', port='/dev/ipmi0')
190
+
191
+ connection = pyipmi.create_connection(interface)
192
+
193
+ connection.target = pyipmi.Target(0x20)
194
+
195
+ connection.open()
196
+ connection.get_device_id()
197
+ connection.close()
198
+ ```
199
+
200
+ ipmitool command:
201
+
202
+ ```shell
203
+ ipmitool -I open -t 0x20 raw 0x06 0x01
204
+ ```
205
+
206
+ ### Bridged targets
207
+
208
+ In ATCA and MicroTCA systems the controllers of blades and AMCs are not
209
+ reachable directly but only through the shelf manager or MCH, which forwards
210
+ (bridges) the requests on IPMB. For these targets set the IPMB address of the
211
+ target and the routing to it. A routing is a list of
212
+ `(requester address, responder address, channel)` tuples, one per hop.
213
+
214
+ Example for an ATCA blade with IPMB address `0x82` behind the shelf manager:
215
+
216
+ ```python
217
+ connection.target = pyipmi.Target(0x82)
218
+ connection.target.set_routing([(0x81, 0x20, 0), (0x20, 0x82, None)])
219
+ ```
220
+
221
+ ipmitool command:
222
+
223
+ ```shell
224
+ ipmitool -I lan -H 10.0.0.1 -p 623 -L "ADMINISTRATOR" -U "admin" -P "admin" -t 0x82 -b 0 raw 0x06 0x01
225
+ ```
226
+
227
+ Do not set a routing to talk to the BMC of a server itself, the bridged
228
+ request fails then (e.g. with completion code `0x83`, NAK on write).
229
+
230
+ Some shelf managers and carrier managers do not return the sequence number
231
+ of a bridged request in their response. If requests time out although the
232
+ device answers (the debug log shows `discarding message that does not match
233
+ the request`), create the native interface with
234
+ `quirks_cfg={'rmcp_ignore_rq_seq': True}`. With the ipmitool backend the
235
+ routing needs the bridge channel of every hop except the last one.
236
+ See the [documentation](https://python-ipmi.readthedocs.io/en/latest/quick_start.html)
237
+ for more routing examples.
238
+
239
+ ## Compatibility
240
+
241
+ Python >= 3.10 is currently supported. Python 2.x is deprecated.
242
+
243
+ ## Contributing
244
+
245
+ Contributions are always welcome. You may send patches directly (eg. `git
246
+ send-email`), do a github pull request or just file an issue.
247
+
248
+ * respect the coding style (eg. PEP8),
249
+ * provide well-formed commit message (see [this blog post](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)),
250
+ * add a Signed-off-by line (eg. `git commit -s`)
251
+
252
+ ## License
253
+
254
+ This library is free software; you can redistribute it and/or modify it
255
+ under the terms of the GNU Lesser General Public License as published by
256
+ the Free Software Foundation; either version 2.1 of the License, or (at
257
+ your option) any later version.
258
+
259
+ This library is distributed in the hope that it will be useful, but WITHOUT
260
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
261
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
262
+ License for more details.
263
+
264
+ You should have received a copy of the GNU Lesser General Public License
265
+ along with this library; if not, write to the Free Software Foundation,
266
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
267
+
268
+ [Total Phase]: http://www.totalphase.com
269
+ [ipmitool]: https://codeberg.org/IPMITool/ipmitool
270
+ [cryptography]: https://pypi.org/project/cryptography/