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

272 Commits

Author SHA1 Message Date
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
Jarrod Johnson
369463eb9f For unspecified sensors use None as the component
Rather than use the string 'Unspecified', use the
None object to denote an event that has no associated
component.

Change-Id: I8b8431257a01434ec09aaa940fab5bbce2164ae6
2015-05-15 14:50:13 -04:00
Jarrod Johnson
612c3fb303 Update decode of HDD OEM events for Lenovo
The specification actually only has the lower 5 bits refer to the slot
number.  Mask out the upper three bits to be accurate.

Change-Id: I654f7a96ad1ae2fd18430ca73aa33b30ce80a8e2
2015-05-15 13:10:41 -04:00
Jarrod Johnson
077941dbfb Declare one sort of 'non-redundancy' ok
This class of non-redundant simply means the resource is inherently
non-redundant per its current configuration.  Other sorts of non-redundant
are available to indicate when this is a consequence of failure.

Change-Id: I0326d13159ccffd2ad790fc8d14fefec17cc2671
2015-05-15 11:04:57 -04:00
Jarrod Johnson
01980e40e9 Add OEM event fixup
Provide a facility for OEM plugins to modify events on the way
out of the event handling functions.

Change-Id: I24f31f7035dcba2c1f30810a6282c87ee987ddad
2015-05-14 16:34:31 -04:00
Jenkins
911762f0c5 Merge "Change event text based on assertion/deassertion" 2015-05-14 18:58:22 +00:00
Jarrod Johnson
6db3e65b0a Change event text based on assertion/deassertion
For the text description and severity, use the negated values
added previously to make it more clear what an event represents.

Change-Id: I9eb47363d5f190bd0fd5bec58bc49fa12a9a3ed0
2015-05-14 14:53:40 -04:00
Jarrod Johnson
c1f6cacd95 Tolerate missing UUID
Some Thinkservers may be missing the UUID field.  Tolerate
this scenario gracefully.

Change-Id: I43793b509030be9b7c161d8fee80cf67b831bbdd
2015-05-14 14:46:45 -04:00
Jarrod Johnson
006710f1e8 Rename 'entity' to 'component'
IPMI carries a connotation of what an 'entity' is.  While
sticking strictly to the nomenclature of 'sensor' that actually
maps would be misleading, entity is also confusing.  Renaming
the element to be 'component' to express what it tends to represent
without getting confused with the IPMI concept of 'entity'.

Change-Id: I592e1e6b9588bf381588c7d9d3e6531eb277d23c
2015-05-14 13:31:44 -04:00
Jarrod Johnson
ab8939910f Leave numbers intact
Some callers of the code would like to use an enumeration
rather than using the strings verbatim or as a key.
Accomodate this through adding fields to carry those
data for such callers.

Change-Id: I75442a12448cdee1e7c0cb99501d6f229cc0c2b2
2015-05-13 16:53:24 -04:00
Jenkins
00da052032 Merge "Flesh out and rework some sensor descriptions" 2015-05-13 17:24:42 +00:00
Jarrod Johnson
d3ccfa3731 Flesh out and rework some sensor descriptions
While implementing events, it suggests that the severity and deassertion
of events warrants a distinct set of enumeration.  Additionally,
the structure made it clear that many of the sensor offsets and their
sensor_type indicated strings were redundant with each other, and
language was changed to eliminate that redundancy.

Change-Id: I1c2f733c4ffb1e7ac2ad8b1004bd560487117b66
2015-05-12 14:48:51 -04:00
Jarrod Johnson
c28ff05b1e Break out of FRU read if zero data returned
If a BMC returns 0 data, then assume end of data has been
reached.  Not all implementations accurately advertise FRU
size, so this is a way to detect and break out.

Change-Id: I03d0393563f8527e16830098b649ae940ee7ee9e
2015-05-07 10:47:23 -04:00
Jarrod Johnson
8c8ce504c1 Fix time correction code
When the change to refactor the event and event_data happened,
the time correction code was not correctly modified.  Rectify
the mistake.

Change-Id: I8317539761456f1c5621745989fbd8ebfc973455
2015-05-06 16:45:30 -04:00
Jarrod Johnson
dd53abfb99 Decrease severity of 'Disabled' presence
This is generally used to indicate the benign configuration
choice of disabling some present device.  For example, a
server with a built in network device disabled in favor of
an add-in option.

Change-Id: I1cf9f4feccf7ec022cca7ce7909093b16807244c
2015-05-06 15:59:15 -04:00
Jarrod Johnson
349a4aa2eb Rename description field and split data out
It would be good for some consumers to have the broad event
description separated from the event specific data.  Facilitate
this with language that makes more clear the piece that refers
broadly to a class of things that can go wrong versus the
potentially very specific data associated with that event.

Change-Id: I983dc1cdf59ae8bc08db3ff3f55192e82f693dbe
2015-05-06 15:45:11 -04:00
Jarrod Johnson
0967ac6025 Implement event log retrieval from BMCs
BMCs retain historical event data in the SEL.
Implement code to read through the SEL.  It
also passes the processed data to the OEM
framework for further processing since
OEMs may define a number of events.
Note that it is not necessarily the OEM of
the system that defines the OEM decode of the
event.  A timestamped OEM event may contain a
different OEM id.  This permits things like
the system, the OS, agents, et all to use the
SEL to store various things.

Change-Id: Ibfb07146b1dfa0ce06df863e805b5a30f17d2f18
2015-05-06 10:44:33 -04:00
Jarrod Johnson
54b90439e7 Add system UUID to inventory
While not strictly in the FRU area, it is often desirable
to have the system UUID available.  The intent is for the
UUID to match what dmidecode would return.  If a manufacturer
does it right, that UUID will be unique.  For ThinkServers,
override with the UUID from the OEM FRU fields rather than
using the get system UUID result.

Change-Id: Ie9a1b7e8fee2cb40ab679cbf2df04db61fd4e42f
0.7.1
2015-04-29 10:54:39 -04:00