messagelog

package
v2.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package messagelog facilitiates communication with Intel® AMT devices to provide access to the AMT event log. Client should read the record time parameter in order to determine which record is newer. In most implementations, log entries are stored backwards, i.e. the newest record is the first record and the oldest record is the last (index based).

Records have no header and the record data is combined of 21 binary bytes which could be read as:

struct {
UINT32 TimeStamp; // little endian
UINT8 DeviceAddress;
UINT8 EventSensorType;
UINT8 EventType;
UINT8 EventOffset;
UINT8 EventSourceType;
UINT8 EventSeverity;
UINT8 SensorNumber;
UINT8 Entity;
UINT8 EntityInstance;
UINT8 EventData[8];
} EVENT_DATA;

Index

Constants

View Source
const (
	AMTMessageLog         string = "AMT_MessageLog"
	GetRecords            string = "GetRecords"
	PositionToFirstRecord string = "PositionToFirstRecord"
	ValueNotFound         string = "Value not found in map"
)

Variables

View Source
var EventSeverity = map[int]string{
	0:  "Unspecified",
	1:  "Monitor",
	2:  "Information",
	4:  "OK",
	8:  "Non-critical condition",
	16: "Critical condition",
	32: "Non-recoverable condition",
}
View Source
var SystemEntityTypes = map[int]string{
	0:  "Unspecified",
	1:  "Other",
	2:  "Unknown",
	3:  "Processor",
	4:  "Disk",
	5:  "Peripheral",
	6:  "System management module",
	7:  "System board",
	8:  "Memory module",
	9:  "Processor module",
	10: "Power supply",
	11: "Add in card",
	12: "Front panel board",
	13: "Back panel board",
	14: "Power system board",
	15: "Drive backplane",
	16: "System internal expansion board",
	17: "Other system board",
	18: "Processor board",
	19: "Power unit",
	20: "Power module",
	21: "Power management board",
	22: "Chassis back panel board",
	23: "System chassis",
	24: "Sub chassis",
	25: "Other chassis board",
	26: "Disk drive bay",
	27: "Peripheral bay",
	28: "Device bay",
	29: "Fan cooling",
	30: "Cooling unit",
	31: "Cable interconnect",
	32: "Memory device",
	33: "System management software",
	34: "BIOS",
	35: "Intel(r) ME",
	36: "System bus",
	37: "Group",
	38: "Intel(r) ME",
	39: "External environment",
	40: "Battery",
	41: "Processing blade",
	42: "Connectivity switch",
	43: "Processor/memory module",
	44: "I/O module",
	45: "Processor I/O module",
	46: "Management controller firmware",
	47: "IPMI channel",
	48: "PCI bus",
	49: "PCI express bus",
	50: "SCSI bus",
	51: "SATA/SAS bus",
	52: "Processor front side bus",
}
View Source
var SystemFirmwareError = map[int]string{
	0:  "Unspecified.",
	1:  "No system memory is physically installed in the system.",
	2:  "No usable system memory, all installed memory has experienced an unrecoverable failure.",
	3:  "Unrecoverable hard-disk/ATAPI/IDE device failure.",
	4:  "Unrecoverable system-board failure.",
	5:  "Unrecoverable diskette subsystem failure.",
	6:  "Unrecoverable hard-disk controller failure.",
	7:  "Unrecoverable PS/2 or USB keyboard failure.",
	8:  "Removable boot media not found.",
	9:  "Unrecoverable video controller failure.",
	10: "No video device detected.",
	11: "Firmware (BIOS) ROM corruption detected.",
	12: "CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)",
	13: "CPU speed matching failure",
}
View Source
var SystemFirmwareProgress = map[int]string{
	0:  "Unspecified.",
	1:  "Memory initialization.",
	2:  "Starting hard-disk initialization and test",
	3:  "Secondary processor(s) initialization",
	4:  "User authentication",
	5:  "User-initiated system setup",
	6:  "USB resource configuration",
	7:  "PCI resource configuration",
	8:  "Option ROM initialization",
	9:  "Video initialization",
	10: "Cache initialization",
	11: "SM Bus initialization",
	12: "Keyboard controller initialization",
	13: "Embedded controller/management controller initialization",
	14: "Docking station attachment",
	15: "Enabling docking station",
	16: "Docking station ejection",
	17: "Disabling docking station",
	18: "Calling operating system wake-up vector",
	19: "Starting operating system boot process",
	20: "Baseboard or motherboard initialization",
	21: "reserved",
	22: "Floppy initialization",
	23: "Keyboard test",
	24: "Pointing device test",
	25: "Primary processor initialization",
}
View Source
var WatchdogCurrentStates = map[int]string{
	1:  "Not Started",
	2:  "Stopped",
	4:  "Running",
	8:  "Expired",
	16: "Suspended",
}

Functions

This section is empty.

Types

type Body

type Body struct {
	XMLName                       xml.Name `xml:"Body"`
	GetResponse                   MessageLogResponse
	EnumerateResponse             common.EnumerateResponse
	PullResponse                  PullResponse
	GetRecordsResponse            GetRecordsResponse
	PositionToFirstRecordResponse PositionToFirstRecordResponse
}

OUTPUTS Response Types.

type Capabilities

type Capabilities int

Capabilities is an array of integers indicating the Log capabilities.

const (
	CapabilitiesUnknown Capabilities = iota
	CapabilitiesOther
	CapabilitiesWriteRecordSupported
	CapabilitiesDeleteRecordSupported
	CapabilitiesCanMoveBackwardInLog
	CapabilitiesFreezeLogSupported
	CapabilitiesClearLogSupported
	CapabilitiesSupportsAddressingByOrdinalRecordNumber
	CapabilitiesVariableLengthRecordsSupported
	CapabilitiesVariableFormatsForRecords
	CapabilitiesCanFlagRecordsForOverwrite
)

func (Capabilities) String added in v2.2.4

func (c Capabilities) String() string

String returns the string representation of the capabilities.

type CharacterSet

type CharacterSet int

CharacterSet is an enumeration describing the character set used to record data in the individual Log entries.

const (
	CharacterSetUnknown CharacterSet = iota
	CharacterSetOther
	CharacterSetASCII
	CharacterSetUnicode
	CharacterSetISO2022
	CharacterSetISO8859
	CharacterSetExtendedUNIXCode
	CharacterSetUTF8
	CharacterSetUCS2
	CharacterSetBitmappedData
	CharacterSetOctetString
	CharacterSetDefinedByIndividualRecords
)

func (CharacterSet) String added in v2.2.4

func (c CharacterSet) String() string

ConvertCharacterSetToString returns the string representation of the character set.

type EnabledDefault

type EnabledDefault int

EnabledDefault is an enumerated value indicating an administrator's default or startup configuration for the Enabled State of an element.

const (
	EnabledDefaultEnabled           EnabledDefault = 2
	EnabledDefaultDisabled          EnabledDefault = 3
	EnabledDefaultNotApplicable     EnabledDefault = 5
	EnabledDefaultEnabledButOffline EnabledDefault = 6
	EnabledDefaultNoDefault         EnabledDefault = 7
	EnabledDefaultQuiesce           EnabledDefault = 9
)

func (EnabledDefault) String added in v2.2.4

func (e EnabledDefault) String() string

String returns the string representation of the enabled default.

type EnabledState

type EnabledState int

EnabledState is an integer enumeration that indicates the enabled and disabled states of an element.

const (
	EnabledStateUnknown EnabledState = iota
	EnabledStateOther
	EnabledStateEnabled
	EnabledStateDisabled
	EnabledStateShuttingDown
	EnabledStateNotApplicable
	EnabledStateEnabledButOffline
	EnabledStateInTest
	EnabledStateDeferred
	EnabledStateQuiesce
	EnabledStateStarting
)

func (EnabledState) String added in v2.2.4

func (e EnabledState) String() string

String returns the string representation of the enabled state.

type GetRecordsResponse

type GetRecordsResponse struct {
	XMLName             xml.Name              `xml:"GetRecords_OUTPUT"`
	IterationIdentifier int                   `xml:"IterationIdentifier"` // An identifier for the iterator.
	NoMoreRecords       bool                  `xml:"NoMoreRecords"`       // Indicates that there are no more records to read
	RecordArray         []string              `xml:"RecordArray"`         // Array of records encoded as Base64
	RawEventData        []RawEventData        `xml:"RawEventData"`        // Slice of raw event data
	RefinedEventData    []RefinedEventData    `xml:"RefinedEventData"`    // Slice of refined event data
	ReturnValue         GetRecordsReturnValue `xml:"ReturnValue"`         // ValueMap={0, 1, 2, 3} Values={Completed with No Error, Not Supported, Invalid record pointed, No record exists in log}
}

OUTPUTS Response Types.

type GetRecordsReturnValue added in v2.2.4

type GetRecordsReturnValue int

GetRecordsReturnValue is an integer indicating the return value of the GetRecords operation.

const (
	GetRecordsReturnValueCompletedWithNoError GetRecordsReturnValue = 0
	GetRecordsReturnValueNotSupported         GetRecordsReturnValue = 1
	GetRecordsReturnValueInvalidRecordPointed GetRecordsReturnValue = 2
	GetRecordsReturnValueNoRecordExistsInLog  GetRecordsReturnValue = 3
)

func (GetRecordsReturnValue) String added in v2.2.4

func (g GetRecordsReturnValue) String() string

String returns the string representation of the GetRecordsReturnValue value.

type GetRecords_INPUT

type GetRecords_INPUT struct {
	XMLName             xml.Name `xml:"h:GetRecords_INPUT"`
	H                   string   `xml:"xmlns:h,attr"`
	IterationIdentifier int      `xml:"h:IterationIdentifier"` // An identifier for the iterator.
	MaxReadRecords      int      `xml:"h:MaxReadRecords"`      // Maximum number of records to read
}

INPUTS.

type HealthState

type HealthState int

HealthState indicates the current health of the element.

const (
	HealthStateUnknown             HealthState = 0
	HealthStateOK                  HealthState = 5
	HealthStateDegraded            HealthState = 10
	HealthStateMinorFailure        HealthState = 20
	HealthStateMajorFailure        HealthState = 25
	HealthStateCriticalFailure     HealthState = 30
	HealthStateNonRecoverableError HealthState = 35
)

func (HealthState) String added in v2.2.4

func (h HealthState) String() string

String returns the string representation of the health state.

type LastChange

type LastChange int

LastChange is an enumeration describing the last change to the MessageLog.

const (
	LastChangeUnknown LastChange = iota
	LastChangeAdd
	LastChangeDelete
	LastChangeModify
	LastChangeLogCleared
)

func (LastChange) String added in v2.2.4

func (l LastChange) String() string

String returns the string representation of the last change.

type LogState

type LogState int

LogState is an integer enumeration that indicates the current state of a log represented by CIM_Log subclasses.

const (
	LogStateUnknown       LogState = 0
	LogStateNormal        LogState = 2
	LogStateErasing       LogState = 3
	LogStateNotApplicable LogState = 5
)

func (LogState) String added in v2.2.4

func (l LogState) String() string

String returns the string representation of the log state.

type MessageLogResponse

type MessageLogResponse struct {
	XMLName                xml.Name            `xml:"AMT_MessageLog"`
	Capabilities           []Capabilities      `xml:"Capabilities"`           // An array of integers indicating the Log capabilities. Information such as "Write Record Supported" (value= 2) or "Variable Length Records Supported" (8) is specified in this property.
	CharacterSet           CharacterSet        `xml:"CharacterSet"`           // An enumeration describing the character set used to record data in the individual Log entries. For example, the Log records may contain ASCII data (value=2), or be raw octet strings (value=10).
	CreationClassName      string              `xml:"CreationClassName"`      // CreationClassName indicates the name of the class or the subclass used in the creation of an instance. When used with the other key properties of this class, this property allows all instances of this class and its subclasses to be uniquely identified.
	CurrentNumberOfRecords int                 `xml:"CurrentNumberOfRecords"` // Current number of records in the Log.
	ElementName            string              `xml:"ElementName"`            // A user-friendly name for the object. This property allows each instance to define a user-friendly name in addition to its key properties, identity data, and description information. Note that the Name property of ManagedSystemElement is also defined as a user-friendly name. But, it is often subclassed to be a Key. It is not reasonable that the same property can convey both identity and a user-friendly name, without inconsistencies. Where Name exists and is not a Key (such as for instances of LogicalDevice), the same information can be present in both the Name and ElementName properties. Note that if there is an associated instance of CIM_EnabledLogicalElementCapabilities, restrictions on this properties may exist as defined in ElementNameMask and MaxElementNameLen properties defined in that class.
	EnabledDefault         EnabledDefault      `xml:"EnabledDefault"`         // An enumerated value indicating an administrator's default or startup configuration for the Enabled State of an element. By default, the element is "Enabled" (value=2).
	EnabledState           EnabledState        `xml:"EnabledState"`           // EnabledState is an integer enumeration that indicates the enabled and disabled states of an element.
	HealthState            HealthState         `xml:"HealthState"`            // Indicates the current health of the element.
	IsFrozen               bool                `xml:"IsFrozen"`               // Boolean indicating that the Log is currently frozen and modifications are not allowed.
	LastChange             LastChange          `xml:"LastChange"`             // An enumeration describing the last change to the MessageLog.
	LogState               LogState            `xml:"LogState"`               // LogState is an integer enumeration that indicates the current state of a log represented by CIM_Log subclasses.
	MaxLogSize             int                 `xml:"MaxLogSize"`             // The maximum size, in bytes, to which the Log can grow. If there is no maximum, then MaxLogSize should be set to 0.
	MaxNumberOfRecords     int                 `xml:"MaxNumberOfRecords"`     // Maximum number of records that can be captured in the Log. If undefined, a value of zero should be specified.
	MaxRecordSize          int                 `xml:"MaxRecordSize"`          // Maximum size, in bytes, to which an individual Log entry (record) can grow - if the Capabilities array includes a value of 7 ("Variable Length Records Supported"). If the Capabilities array does not include a 7, then the Log only supports fixed length entries. The size of these entries is described by this property.
	Name                   string              `xml:"Name"`                   // The inherited Name serves as part of the key (a unique identifier) for the MessageLog instance.
	OperationalStatus      []OperationalStatus `xml:"OperationalStatus"`      // Indicates the current statuses of the element.
	OverwritePolicy        OverwritePolicy     `xml:"OverwritePolicy"`        // An enumeration describing the behavior of the Log, when it becomes full or near full.
	PercentageNearFull     int                 `xml:"PercentageNearFull"`     // If the OverwritePolicy is based on clearing records when the Log is near full (value=3), this property defines the record capacity (in percentage) that is considered to be 'near full'.
	RequestedState         RequestedState      `xml:"RequestedState"`         // RequestedState is an integer enumeration that indicates the last requested or desired state for the element, irrespective of the mechanism through which it was requested.
	SizeOfHeader           int                 `xml:"SizeOfHeader"`           // The size of the Log header, in bytes, if one is present. If there is no Log header, then this property should be set to 0. Headers may include general information about the Log such as the current number of records, time of last update, or a pointer to the location of the first Log entry. Note that this property is NOT the size of the header for an individual Log entry. The latter is described by the property, SizeOfRecordHeader.
	SizeOfRecordHeader     int                 `xml:"SizeOfRecordHeader"`     // The size of the header for the Log's individual entries, in bytes, if record headers are defined. If there are no record headers, then this property should be set to 0. Record headers may include information such as the type of the Log entry, the date/time that the entry was last updated, or a pointer to the start of optional data. Note that this property defines the header size for individual records in the Log, while the SizeOfHeader property describes the Log's overall header, typically located at the start of the MessageLog.
	Status                 string              `xml:"Status"`                 // A string indicating the current status of the object. This property is deprecated in lieu of OperationalStatus, which includes the same semantics in its enumeration.
}

OUTPUTS Response Types.

type OperationalStatus

type OperationalStatus int

OperationalStatus indicates the current statuses of the element.

const (
	OperationalStatusUnknown OperationalStatus = iota
	OperationalStatusOther
	OperationalStatusOK
	OperationalStatusDegraded
	OperationalStatusStressed
	OperationalStatusPredictiveFailure
	OperationalStatusError
	OperationalStatusNonRecoverableError
	OperationalStatusStarting
	OperationalStatusStopping
	OperationalStatusStopped
	OperationalStatusInService
	OperationalStatusNoContact
	OperationalStatusLostCommunication
	OperationalStatusAborted
	OperationalStatusDormant
	OperationalStatusSupportingEntityInError
	OperationalStatusCompleted
	OperationalStatusPowerMode
	OperationalStatusRelocating
)

func (OperationalStatus) String added in v2.2.4

func (o OperationalStatus) String() string

String returns the string representation of the operational status.

type OverwritePolicy

type OverwritePolicy int

OverwritePolicy is an enumeration describing the behavior of the Log, when it becomes full or near full.

const (
	OverwritePolicyUnknown OverwritePolicy = iota
	OverwritePolicyOther
	OverwritePolicyWrapWhenFull
	OverwritePolicyClearWhenFull
	OverwritePolicyOverwriteOutdatedWhenNeeded
	OverwritePolicyRemoveOutdatedRecords
	OverwritePolicyOverwriteSpecificRecords
	OverwritePolicyNeverOverwrite
)

func (OverwritePolicy) String added in v2.2.4

func (o OverwritePolicy) String() string

String returns the string representation of the overwrite policy.

type PositionToFirstRecordResponse

type PositionToFirstRecordResponse struct {
	XMLName             xml.Name                         `xml:"PositionToFirstRecord_OUTPUT"`
	IterationIdentifier int                              `xml:"IterationIdentifier"` // An identifier for the iterator.
	ReturnValue         PositionToFirstRecordReturnValue `xml:"ReturnValue"`         // ValueMap={0, 1, 2} Values={Completed with No Error, Not Supported, No record exists}
}

OUTPUTS Response Types.

type PositionToFirstRecordReturnValue added in v2.2.4

type PositionToFirstRecordReturnValue int

PositionToFirstRecordReturnValue is an integer indicating the return value of the PositionToFirstRecord operation.

const (
	PositionToFirstRecordReturnValueCompletedWithNoError PositionToFirstRecordReturnValue = 0
	PositionToFirstRecordReturnValueNotSupported         PositionToFirstRecordReturnValue = 1
	PositionToFirstRecordReturnValueNoRecordExists       PositionToFirstRecordReturnValue = 2
)

func (PositionToFirstRecordReturnValue) String added in v2.2.4

String returns the string representation of the PositionToFirstRecordReturnValue value.

type PullResponse

type PullResponse struct {
	XMLName         xml.Name             `xml:"PullResponse"`
	MessageLogItems []MessageLogResponse `xml:"Items>AMT_MessageLog"`
}

OUTPUTS Response Types.

type RawEventData added in v2.6.0

type RawEventData struct {
	TimeStamp       uint32
	DeviceAddress   uint8
	EventSensorType uint8
	EventType       uint8
	EventOffset     uint8
	EventSourceType uint8
	EventSeverity   uint8
	SensorNumber    uint8
	Entity          uint8
	EntityInstance  uint8
	EventData       []uint8
}

OUTPUTS Response Types.

type RefinedEventData added in v2.6.0

type RefinedEventData struct {
	TimeStamp       time.Time
	DeviceAddress   uint8
	Description     string
	Entity          string
	EntityInstance  uint8
	EventData       []uint8
	EventSensorType uint8
	EventType       uint8
	EventOffset     uint8
	EventSourceType uint8
	EventSeverity   string
	SensorNumber    uint8
}

OUTPUTS Response Types.

type RequestedState

type RequestedState int

RequestedState is an integer enumeration that indicates the last requested or desired state for the element, irrespective of the mechanism through which it was requested.

const (
	RequestedStateUnknown       RequestedState = 0
	RequestedStateEnabled       RequestedState = 2
	RequestedStateDisabled      RequestedState = 3
	RequestedStateShutDown      RequestedState = 4
	RequestedStateNoChange      RequestedState = 5
	RequestedStateOffline       RequestedState = 6
	RequestedStateTest          RequestedState = 7
	RequestedStateDeferred      RequestedState = 8
	RequestedStateQuiesce       RequestedState = 9
	RequestedStateReboot        RequestedState = 10
	RequestedStateReset         RequestedState = 11
	RequestedStateNotApplicable RequestedState = 12
)

func (RequestedState) String added in v2.2.4

func (r RequestedState) String() string

String returns the string representation of the requested state.

type Response

type Response struct {
	*client.Message
	XMLName xml.Name       `xml:"Envelope"`
	Header  message.Header `xml:"Header"`
	Body    Body           `xml:"Body"`
}

OUTPUTS Response Types.

func (*Response) JSON

func (r *Response) JSON() string

JSON marshals the type into JSON format.

func (*Response) YAML

func (r *Response) YAML() string

YAML marshals the type into YAML format.

type Service added in v2.5.2

type Service struct {
	// contains filtered or unexported fields
}

func NewMessageLogWithClient

func NewMessageLogWithClient(wsmanMessageCreator *message.WSManMessageCreator, client client.WSMan) Service

NewMessageLogWithClient instantiates a new MessageLog.

func (Service) Enumerate added in v2.5.2

func (messageLog Service) Enumerate() (response Response, err error)

Enumerate returns an enumeration context which is used in a subsequent Pull call.

func (Service) Get added in v2.5.2

func (messageLog Service) Get() (response Response, err error)

Get retrieves the representation of the instance.

func (Service) GetRecords added in v2.5.2

func (messageLog Service) GetRecords(identifier int) (response Response, err error)

GetRecords retrieves multiple records from event log. The IterationIdentifier input parameter is a numeric value (starting at 1) which is the position of the first record in the log that should be extracted. MaxReadRecords is set to 390. If NoMoreRecords returns false, call this again setting the identifier to the start of the next IterationIdentifier.

func (Service) PositionToFirstRecord added in v2.5.2

func (messageLog Service) PositionToFirstRecord() (response Response, err error)

Requests that an iteration of the MessageLog be established and that the iterator be set to the first entry in the Log. An identifier for the iterator is returned as an output parameter of the method. Regarding iteration, you have 2 choices: 1) Embed iteration data in the method call, and allow implementations to track/ store this data manually; or, 2) Iterate using a separate object (for example, class ActiveIterator) as an iteration agent. The first approach is used here for interoperability. The second requires an instance of the Iterator object for EACH iteration in progress. 2's functionality could be implemented underneath 1.

Product Specific Usage: In current implementation this method doesn't have any affect. In order to get the events from the log user should just call GetRecord or GetRecords.

func (Service) Pull added in v2.5.2

func (messageLog Service) Pull(enumerationContext string) (response Response, err error)

Pull returns the instances of this class. An enumeration context provided by the Enumerate call is used as input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL