2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

289 Commits

Author SHA1 Message Date
Jarrod Johnson
ed700d6603 Use alert set 1 unconditionally
The 'policy number' appears to be indicating a set rather
than a specific rule.  Since PEF from various manufacturers
tend to use alert set 1, use alert set 1 for now when creating
a new policy.

Change-Id: I646c81baa3167f3fc076140494f7e8e564e7c0bd
2015-09-25 09:24:41 -04:00
Jenkins
79d23bd4c6 Merge "Implement get/set of DCMI asset tag and MCI" 2015-09-08 13:18:47 +00:00
Jarrod Johnson
5f42788179 Implement get/set of DCMI asset tag and MCI
DCMI provides standard commands for accessing/setting asset tag and
BMC identifier.  Provide access to those facilities

Change-Id: If3f99d308e5b37ff3e99f19fd804f00a74bbb561
2015-09-04 16:37:28 -04:00
Juliana Motira
8dfc6c1a4d Add custom OEM PSU Based Power Capping config
for Lenovo ThinkServers

Change-Id: I0ee2d42d3c066befe7abbf958df3952c1b43e0a6
2015-09-04 08:42:44 -03:00
Jarrod Johnson
658c59f885 Autoenable alert policy for a destination
If an alert destination is set, there is no guarantee an
alert policy will actually use it.  Have the set_alert_destination
go through the alert policy table checking for an entry that references
the most recently set value, creating one if no match found.

Change-Id: I6bef40dddb18ababb3d85bb02e5d0ae73c82df2f
2015-09-02 10:02:36 -04:00
Juliana Motira
9d7782692a Add reset bmc command
Change-Id: I3d027303667ade4ad3790c5c614ea01f2ead6e39
2015-08-27 12:11:45 -03:00
Lucio Seki
41db3b8866 Add NMI diag command
Change-Id: Ie1e3b1033eff61b77df76b5261824748ed089b90
2015-08-27 09:05:11 -03:00
Lucio Seki
407c180d70 Add RAID drive and controller to ThinkServer inventory
Change-Id: Icfda252540cf4e2a7da720530889c9d60fbfeeff
2015-08-25 09:44:40 -03:00
Juliana Motira
0fb56d6de9 Changing Lenovo custom get_leds method
Change-Id: I7b57649a40935aa9f525b972c37199b7f3920bb6
2015-08-24 14:39:36 -03:00
Jenkins
6ca968e6bb Merge "Silently ignore broken sensors rather than error" 2015-08-24 17:21:31 +00:00
Juliana Motira
76f5c69e72 Add custom OEM firmware info parsing for Lenovo ThinkServers
Parse Version Info and add a command to retrieve it.

Change-Id: I7c321efb4861392fb4a9151ffd2a64ae2b5b7a42
2015-08-24 09:21:52 -03:00
Jarrod Johnson
4b72e8e769 Silently ignore broken sensors rather than error
Rather than break on bad sensor data from a vendor,
delete the records that are likely to have bad data.

Change-Id: I6417cd60b2f12e8979e25b3240a086a8aa5377ad
2015-08-20 17:03:00 -04:00
Jenkins
037b31ab5b Merge "Lessen degree of admin backoff" 2015-08-20 21:00:28 +00:00
Jarrod Johnson
b003f8f1ce Lessen degree of admin backoff
When completing RAKP, but denied by set session privilege level,
just repeat set session privilege level at lower privilege
rather than trying to go all the way back.

Change-Id: I3cc10320e81b8a3db3ebb7b17026f0d233e0b808
2015-08-20 16:30:26 -04:00
Juliana Motira
70aab7d76d Add disable user command
Change-Id: Ibdbdaa30677b916899b970b4923a65986334f7f6
2015-08-20 11:34:46 -03:00
Allan Vidal
59355018c4 Add LED parsing for Lenovo ThinkServers
Read and parse OEM LED status. Also remove a file that was no longer necessary.

Change-Id: I98b5de64e75eb66919cc6f8476157eb3a341ead1
2015-08-18 17:54:39 -03:00
Allan Vidal
ea3960c226 Add custom OEM inventory parsing for Lenovo ThinkServers
Parse OEM data for CPU, DIMM, PCI, drive and PSU inventory.

Change-Id: Ic75d03fb1b05c13702321d174c8dbb9a96a08ae4
2015-08-14 15:23:15 -03:00
Jarrod Johnson
74f7c4d936 Implement setting IPv4 configuration on target
As a complement to the previous change to read network configuration data, accept configuration
input and submit to the BMC.

Change-Id: I3d29237c98943fc93c160450861ac9c5d8e7758d
2015-08-05 13:04:44 -04:00
Jarrod Johnson
1cfc4bf4ac Implement read of IPv4 network configuration
Use standard IPv4 related configuration parameters
to fetch relevant data for basic network connectivity.

Change-Id: I2b93da5be0196ff5f15e240ed8f8e0fd819ddd54
2015-08-03 15:00:45 -04:00
Jarrod Johnson
abb453015a Reword some event/sensor text
The physical security related events/sensors
were confusing.  Reword them for better
understanding.

Change-Id: I033b07195848123494d30d9826f441bba140fd10
2015-07-20 11:35:59 -04:00
Jenkins
786eddeb18 Merge "Support 20 byte passwords" 2015-07-20 14:49:09 +00:00
Jarrod Johnson
4e9784b185 Provide numeric key data in state description
Sensor readings have new fields added, allowing some callers
to use easier comparison and lookups.  For example some
may want to have a full setence string for permutation of
reading types, sensor types, and specific event.

Change-Id: I743a32777259516f8febf5a0a62757ce5a4cee59
2015-07-15 16:20:23 -04:00
Jarrod Johnson
9dbb24236f Support 20 byte passwords
The IPMI 2.0 spec allows 20 byte passwords.
If a password is less than 16 bytes, then use
the 1.5 scheme as before.  If between 16 and 21,
then attempt IPMI 2.0 scheme.  Raise when over 20.

Change-Id: I25016b8608d9dbf5d436afd75bd07f0d4eed6d81
2015-07-15 14:19:33 -04:00
Jarrod Johnson
d89be6b894 Provide time data in alert decode
When an alert is received, decode the
provided timestamp.  Additionally apply
the time correction logic as used on the
event log data.

Change-Id: I2534f3b8288739e1b50fd335d878e9c4b5458b28
2015-07-13 09:49:27 -04:00
Jenkins
590faabd4c Merge "Extend and document user_delete in ipmi.command" 2015-07-07 17:57:53 +00:00
Jenkins
098ef93113 Merge "Have session.py work better in Windows" 2015-07-07 14:48:24 +00:00
Jarrod Johnson
cf01aa5fdb Extend and document user_delete in ipmi.command
User deletion has some limitations making the function a best effort.
Document this and provide at least one additional attempt at deleting
a user to cover more vendors.  This still does not cover all vendors,
and OEM extensibility is likely to be the answer to allow this to
cover more implementations.

Change-Id: I6af3f761c587f9eb8b58b3408052d6585847f7d6
2015-07-07 10:47:59 -04:00
Jarrod Johnson
02c058ee06 Have session.py work better in Windows
Have monotonic_time reworked to use Windows function
when available.  Eliminate use of an os.pipe to break
into the select.  When we want to interrupt the select,
use the first udp socket as the angle to break in.
Additionally, provide a Windows friendly value for
IPPROTO_IPV6 should the socket module fail us.

Change-Id: I8f566543c8da28eb7ed76f1cb80ff4cb2dcbba96
2015-07-02 16:26:25 -04:00
Jarrod Johnson
5b7bd84895 Fix PET acknowledge errors
The PET acknowledge code was incorrect.  Fix it by
properly extracting the fields by index and fixing reference
to self._ipmicmd and also do not treat a failure on acknowledge as
an error for now.

Change-Id: Icafc21807a59e53acf3249170450bf4dbeee9e5d
2015-06-30 10:54:16 -04:00
Jarrod Johnson
180288fe51 Provide useful error on bad username
When a bad username was supplied, an attempt to start over
was done without resetting the state machine of the retransmit
facility.  As a consequence, it failed to actually proceed in
restarting the process and would time out rather than returning
the appropriate error.

Change-Id: Ib3207c214fcf96f0dcdb8c4ca3b5387fb58ce1ae
2015-06-23 09:36:21 -04:00
Jenkins
20cbbf2470 Merge "Acknowledge PET alert on decode" 2015-06-18 12:52:07 +00:00
Jarrod Johnson
7ba12de874 Gather Thinkserver CPU and Memory independently
If CPU inventory is unavalible, proceed to get memory inventory.
If memory inventory is unavailable, cleanly omit the data.

Change-Id: If9d5eec1aa5dcc7a2800e30636ff4cedee48a311
2015-06-11 14:33:12 -04:00
Jarrod Johnson
59d7945957 Handle Lenovo Thinkserver lacking OEM inventory
If a Thinkserver responds negatively to request for OEM
inventory data, gracefully drop out and return empty
information rather than passing it up the stack.

Change-Id: I16d176606bb95d56244dfea43f9d828ff046bbc1
2015-06-11 13:36:31 -04:00
Jarrod Johnson
d6f0a2797a Add record id to SEL data
Provide calling code with the identifier number for a particular event.

Change-Id: Icc274e5475b7a266c1ff36bdc796197e98256a8c
2015-06-10 13:46:12 -04:00
Jarrod Johnson
26942c7860 Provide extensibility to sensors by OEM
OEMs frequently employ special commands for data that logically
would be expected to manifest as a sensor.  Provide a facility
for OEMs to make up sensors and provide data in the form of a
'sensor' without requiring SDR.

Change-Id: I6bce99680ff64ffe2dbc0898d193a17dde066b9c
2015-06-09 11:11:02 -04:00
Jarrod Johnson
275288cf79 Acknowledge PET alert on decode
In case a PET emitter wants acknowledgement,
submit a PET acknowledge back to the relevant
BMC when decoding a PET event.

Change-Id: Ifd3038fec2f72161b48bbf7095d2a0e2100b4d91
2015-06-08 14:22:31 -04:00
Jarrod Johnson
9e64b16291 Provide interface for decoding PET alerts
Enable a python application tasked with decoding PET
coming in via SNMP to decode it in the same manner
an event log entry is decoded.

Change-Id: If8272989ba5d9062183e5decab959729dda85d62
0.8.0
2015-06-08 09:55:40 -04:00
Jarrod Johnson
249ea5dda2 Handle unknown entity ids
Vendors can do other entitiy ids.  Have a catch all
that provides the raw value in case there
is no better lookup for the number.

Change-Id: I66a226e1b38f6b31b95bfe58e044875decae09a8
2015-06-05 13:55:30 -04:00
Jenkins
aeece54e4c Merge "Tolerate alternative return code for FRU size" 2015-06-05 15:29:39 +00:00
Jarrod Johnson
6cfa823ea9 Tolerate alternative return code for FRU size
202 means 'Cannot return number of request bytes', which is pretty on the nose
for the scenario at hand.  Include that in the conditions to reduce the request size.
Thanks to Rafael Debarros for this.

Change-Id: I833faf2559a93e468748a72db29e6967bc800207
2015-06-05 11:00:25 -04:00
Jenkins
2ce2665933 Merge "Remove libvirt from requirements" 2015-06-03 19:09:15 +00:00
Jarrod Johnson
7f88daa8ca Remove libvirt from requirements
Only some use the virtual bmc function.  Remove it
from requirements to make packaging easier.

Change-Id: I464450f8b6a6bfc7fd6ff189f1a9b680d96d928f
2015-06-03 14:37:31 -04:00
Jarrod Johnson
f88c8e8839 Provide access to get/set community string
For SNMP alert processing, each channel can have an associated
community string.  Provide access to this configuration parameter.

Change-Id: Ib1cb98e436fc104d803ef7e594b92c46f8756171
2015-06-03 14:35:48 -04:00
Jarrod Johnson
728969a7bf Add serial field from SPD
Add serial number data from SPD to standard SPD decode

Change-Id: I380d6a36726daf0a9c23ab0bf8245f4b8c975658
2015-06-03 13:24:11 -04:00
Jarrod Johnson
25edd1ac31 Implement OEM Inventory components
Provide a framework for OEM to add inventory devices
without requiring FRU locator records.  This enables
vendors to provide additional data in a more flexible
scheme.

Change-Id: I9ef9685de9150940321aecbf2cc275cfbbe8ce6a
2015-06-03 10:09:35 -04:00
Jarrod Johnson
9efd878fd5 Report/Configure LAN alert destinations
Provide a facility to manipulate the LAN alert destinations.
Additionally update the LAN configuration functions to have
a function to intelligently find the correct LAN channel.
For now the 'check current channel' preference should always
activate, but the function should be able to cover a hypothetical
in-band scenario should session become so enabled.

Change-Id: I45ce81addb882110e04d0526997a96b6b2ab0c2e
2015-05-29 13:41:01 -04:00
Jarrod Johnson
8b94506ce9 Implement Thinkserver OEM SEL decode
The Thinkserver platform may have a number of OEM entries.
Provide a reasonable decode of those events.

Change-Id: Ie4be9848293c00e8b0d3490075101ed8be1cf72e
2015-05-20 15:16:54 -04:00
Jarrod Johnson
3db5df1b4a Fix behavior with some Lenovo Thinkservers
FRU data may return 0x81 on not-present devices and also
provide some rough event description in the case of an
unknown OEM SEL format.

Change-Id: Ia99c4981c06ed8e067a584896fde3880f08f8baa
2015-05-19 16:51:29 -04:00
Jarrod Johnson
e019fb4c88 Only conditionally delete fields from event
If some events (for example, OEM events) are encountered,
the deleted fields won't exist in the first place.  Avoid
KeyErrors by checking before deleting.

Change-Id: I91ca73f4288c7b877589e766c8ce1ea1166e0d37
2015-05-19 15:38:56 -04:00
Jarrod Johnson
329e9fc188 Fix python2.6 usage of unpack_from
unpack_from in python 2.6 can't handle a bytearray.  Make it a buffer
before trying to unpack_from

Change-Id: I0b1014eba7b1001e79edb2bee1e1dc5b59eda36c
2015-05-15 16:08:45 -04:00