hyvedesignsolutions / hyve-pyipmi Goto Github PK
View Code? Open in Web Editor NEWPure Python-based IPMI client developed by Hyve Design Solutions.
Home Page: https://hyvedesignsolutions.blogspot.com
License: Other
Pure Python-based IPMI client developed by Hyve Design Solutions.
Home Page: https://hyvedesignsolutions.blogspot.com
License: Other
On 3.10 any module(s) that use the # variant when parsing arguments need to have a #define PY_SSIZE_T_CLEAN before including Python.h.
From the docs:
For all # variants of formats (s#, y#, etc.), the macro PY_SSIZE_T_CLEAN must be defined before including Python.h. On Python 3.9 and older, the type of the length argument is Py_ssize_t if the PY_SSIZE_T_CLEAN macro is defined, or int otherwise.
Solution
pip uninstall pycrypto
pip install pycryptodome
Can you update the requirements.txt with pycryptodome
BTW, thanks for the package. Great Job.
I did a quick copy of your Sample1 script to get the user name for user 2 -
(important bits, all the rest pretty much identical)
print('\nGet User Name 2:')
rsp = self.intf.issue_raw_cmd([6, 0x46, 2])
self.print_rsp(rsp)
It returned -
00 41 44 4d 49 4e 00 00 00 00 00 00 00 00 00 00 00
Looking at tcpdump
and using ipmitool
to check the output -
ipmitool -H 192.168.0.24 -I lan -U ADMIN -P ADMIN raw 0x06 0x46 0x02
I'd expect the output to be only the data part of the response packet, which starts at 41
... am I missing something (or wrong, or overly tired, or......)
So kicking the tires... the package looks promising, and it's always good to have new options in the IPMI sphere.
But it's a bit opaque at times... I don't want to have to grep
the source the first time or two I'm trying a command.
It'd be great to be able to see more of what's moving to/fro from the host to BMC, both in terms of hidden (e.g. cached) arguments as well as hex codes, with both errors and successful output.
For instance, I run -
pyipmi -H 192.168.0.24 -I lanplus -U ADMIN -U ADMIN lan print 1 PyIntfExcept: Key Exchange Authentication Code is not valid in RAKP 2.
or - perhaps the error PyIntfExcept: Invalid RMCP AuthCode in response
when I use the -I lan
in the same command. Sure, I was distracted and didn't put in a password and instead used two -U
options... but then I get back a couple of mysterious error codes... it's not clear at all what was used as a password, if anything. And when running multiple different -U
's, the tool ignores all but the last... yes, this is what ipmitool
does, but it's not super user friendly, and since its output isn't the same as ipmitool
, you're not doing exactly what it does, so.....
Perhaps echo the command + full args actually used to stderr or something? Or even just when cached values are used (this isn't an issue with ipmitool
, since it doesn't cache things.)
If there was a --debug
or --hex
or whatever option that echoed what was really going back and forth, sort of what ipmitool
and others do with the -v -v -v -v -v
options, that would have helped me figure out what's going on (admittedly, this wouldn't help many, but hey :))
I'll probably have more comments to come, but thanks for the toolset.
Perhaps the pyipmi.conf
file should be updated only on successful attempts? I'm not sure the big win on caching the last unsuccessful attempt. In addition once it's written to, it seems to not fill in values for sections that aren't valid/just defaults, like after a -I lanplus
command the -I lan
gets filled in with nonsense.
The using cached passwords is interesting... I'm on the fence myself, but if you're going to do it, I'd say you may as well go all the way, and save for individual IPs/hosts within the various interfaces, like:
[lan]
[10.0.0.1]
user = root
password = root123
auth = md5
port = 623
[192.0.168.1]
user = admin
password = admin
auth = md5
port = 666
....
(Maybe have a --dangerous
flag to save passwords for all hosts ;))
You could also put behavior variables in the [global] section, like [always-force], [CIPHER_SUITE], [port] (can be overridden by individual targets), etc., etc.
(I'm not sure what the no_ping
option means.)
Hi,Dr Au:
when i use the command"pyipmi -H ip -I lanplus -U user -p password fru print", i can get only the info about board,
it hint me the message that is 'Failed to get Product Info Area'.
but it's work that i use ipmitool command.
my device is Huawei 2288H V5. my env is linux CentOS Linux release 8.1.1911
i wanna know the specific possible reasons?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.