Documentation ¶
Index ¶
- Constants
- type AboutOutput
- type BatteryProbe
- type BusProtocol
- type ChassisBatteriesOutput
- type ChassisEntry
- type ChassisFansOutput
- type ChassisInfoOutput
- type ChassisMemoryOutput
- type ChassisOutput
- type ChassisPowerMonitoringOutput
- type ChassisPowerSuppliesOutput
- type ChassisProcessorsOutput
- type ChassisTempsOutput
- type Config
- type Controller
- type Dimm
- type Enclosure
- type FanProbe
- type Fans
- type FirmwareEntry
- type Layout
- type OMReport
- func (om *OMReport) About() (*AboutOutput, error)
- func (om *OMReport) Chassis() (*ChassisOutput, error)
- func (om *OMReport) ChassisBatteries() (*ChassisBatteriesOutput, error)
- func (om *OMReport) ChassisFans() (*ChassisFansOutput, error)
- func (om *OMReport) ChassisInfo() (*ChassisInfoOutput, error)
- func (om *OMReport) ChassisMemory() (*ChassisMemoryOutput, error)
- func (om *OMReport) ChassisPowerMonitoring() (*ChassisPowerMonitoringOutput, error)
- func (om *OMReport) ChassisPowerSupplies() (*ChassisPowerSuppliesOutput, error)
- func (om *OMReport) ChassisProcessors() (*ChassisProcessorsOutput, error)
- func (om *OMReport) ChassisTemps() (*ChassisTempsOutput, error)
- func (om *OMReport) Report(args ...string) ([]byte, error)
- func (om *OMReport) StorageController() (*StorageControllerOutput, error)
- func (om *OMReport) StorageEnclosure() (*StorageEnclosureOutput, error)
- func (om *OMReport) StoragePDisk(cid int) (*StoragePDiskOutput, error)
- func (om *OMReport) StorageVDisk() (*StorageVDiskOutput, error)
- func (om *OMReport) SuspiciousOMCLIProxyBinary() error
- type OMReporter
- type PDisk
- type PowerProbe
- type PowerSupply
- type PowerSupplyState
- type Probe
- type Processor
- type ProcessorProbe
- type State
- type Status
- type StorageControllerOutput
- type StorageEnclosureOutput
- type StoragePDiskOutput
- type StorageVDiskOutput
- type TemperatureProbe
- type VDisk
- type Voltages
Constants ¶
const ( // DefaultOMCLIProxyDir is the default path to directory that contains omcliproxy. DefaultOMCLIProxyDir = "/opt/dell/srvadmin/sbin" // DefaultOMCLIProxyBinaryName is the default name of the omcliproxy binary. DefaultOMCLIProxyBinaryName = "omcliproxy" // DefaultOMReportCommandName is the default name of omreport subcommand passed to omcliproxy. DefaultOMReportCommandName = "omreport" )
const ( AttrLogicalConnector = 1 << 6 AttrGlobalHS = 1 << 7 AttrDedicatedHS = 1 << 8 AttrNonRAID = 1 << 9 AttrFailurePredicted = 1 << 11 StatusOK Status = 2 StatusNonCritical Status = 3 StatusCritical Status = 4 StateReady State = 1 StateFailed State = 2 StateOnline State = 4 StateOffline State = 8 StateDegraded State = 32 StateNonRAID State = 4096 StateReplacing State = 2097152 StateRebuilding State = 8388608 StateBackgroundInitialization State = 34359738368 StateForeign State = 274877906944 StateClear State = 549755813888 StateDegradedRedundancy State = 9007199254740992 LayoutRAID0 Layout = 2 LayoutRAID1 Layout = 4 LayoutRAID5 Layout = 64 LayoutRAID6 Layout = 128 LayoutRAID60 Layout = 262144 BusProtocolSCSI BusProtocol = 1 BusProtocolIDE BusProtocol = 2 BusProtocolSATA BusProtocol = 7 BusProtocolSAS BusProtocol = 8 BusProtocolPCIe BusProtocol = 9 // NaN is an enum for fields that use the string 'N/A'. NaN = -1 << 31 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AboutOutput ¶
type AboutOutput struct {
Version string `xml:"About>ProductVersion"`
}
AboutOutput models the output of 'omreport about'.
type BatteryProbe ¶
type BatteryProbe struct { ID int `xml:"index,attr"` Location string `xml:"ProbeLocation"` Status Status `xml:"objstatus"` }
BatteryProbe models a battery probe described by omreport.
type BusProtocol ¶
type BusProtocol int
BusProtocol models the bus protocol used by a hardware component.
func (*BusProtocol) String ¶
func (b *BusProtocol) String() string
type ChassisBatteriesOutput ¶
type ChassisBatteriesOutput struct {
Probes []BatteryProbe `xml:"BatteryObj"`
}
ChassisBatteriesOutput models the output of 'omreport chassis batteries'.
type ChassisEntry ¶
type ChassisEntry struct { Hostname string `xml:"ChassisInfo>SystemInfo>SystemName"` FirmwareList []FirmwareEntry `xml:"ChassisInfo>FirmwareList>Firmware"` Model string `xml:"ChassisInfo>ChassisProps1>ChassModel"` LockPresent bool `xml:"ChassisInfo>ChassisProps1>ChassLockPresent"` ServiceTag string `xml:"ChassisInfo>ChassisProps2>ServiceTag"` }
ChassisEntry models a chassis described by omreport.
type ChassisFansOutput ¶
type ChassisFansOutput struct {
Probes []FanProbe `xml:"Chassis>FanProbeList>FanProbe"`
}
ChassisFansOutput models the output of 'omreport chassis fans'.
type ChassisInfoOutput ¶
type ChassisInfoOutput struct {
ChassisList []ChassisEntry `xml:"ChassisList>Chassis"`
}
ChassisInfoOutput models the output of 'omreport chassis info'.
type ChassisMemoryOutput ¶
type ChassisMemoryOutput struct { TotalPhysicalMemorySize float64 `xml:"MemoryInfo>TotalPhysMemorySize"` AvailablePhysicalMemorySize float64 `xml:"MemoryInfo>AvailPhysMemorySize"` Dimms []Dimm `xml:"MemDevObj"` Status Status `xml:"ObjStatus"` }
ChassisMemoryOutput models the output of 'omreport chassis memory'.
type ChassisOutput ¶
type ChassisOutput struct { FansStatus Status `xml:"Parent>fans>computedobjstatus"` MemoryStatus Status `xml:"Parent>memory>computedobjstatus"` PowerSuppliesStatus Status `xml:"Parent>powersupply>computedobjstatus"` PowerManagementStatus Status `xml:"Parent>powermonitoring>computedobjstatus"` ProcessorsStatus Status `xml:"Parent>processor>computedobjstatus"` TemperaturesStatus Status `xml:"Parent>temperatures>computedobjstatus"` VoltagesStatus Status `xml:"Parent>voltages>computedobjstatus"` HardwareLogStatus Status `xml:"Parent>esmlog>computedobjstatus"` BatteriesStatus Status `xml:"Parent>batteries>computedobjstatus"` }
ChassisOutput models the output of 'omreport chassis'.
type ChassisPowerMonitoringOutput ¶
type ChassisPowerMonitoringOutput struct { Probes []PowerProbe `xml:"CurrentProbeList>CurrentProbe"` Status Status `xml:"ObjStatus"` }
ChassisPowerMonitoringOutput models the output of 'omreport chassis pwrmonitoring'.
type ChassisPowerSuppliesOutput ¶
type ChassisPowerSuppliesOutput struct {
PowerSupplies []PowerSupply `xml:"Chassis>PowerSupplyList>PowerSupply"`
}
ChassisPowerSuppliesOutput models the output of 'omreport chassis pwrsupplies'.
type ChassisProcessorsOutput ¶
type ChassisProcessorsOutput struct { Processors []Processor `xml:"ProcessorList>ProcessorConn"` Probes []ProcessorProbe `xml:"CPUStatusProbeList>CPUStatusProbe"` }
ChassisProcessorsOutput models the output of 'omreport chassis processors'.
type ChassisTempsOutput ¶
type ChassisTempsOutput struct {
Probes []TemperatureProbe `xml:"Chassis>TemperatureProbeList>TemperatureProbe"`
}
ChassisTempsOutput models the output of 'omreport chassis temps'.
type Controller ¶
type Controller struct { ID int `xml:"ControllerNum"` Name string `xml:"Name"` Status Status `xml:"ObjStatus"` State State `xml:"ObjState"` }
Controller models a controller described by omreport.
type Dimm ¶
type Dimm struct { ArrayNo int `xml:"deviceSet"` AssetTag string `xml:"AssetTag"` Errors int `xml:"errCount"` MultiBitErrors int `xml:"mbErrCount"` Name string `xml:"DeviceLocator"` PartNo string `xml:"PartNumber"` SingleBitErrors int `xml:"sbErrCount"` }
Dimm models a single memory module.
type Enclosure ¶
type Enclosure struct { ID int `xml:"EnclosureID"` ControllerID int `xml:"ControllerNum"` Status Status `xml:"ObjStatus"` State State `xml:"ObjState"` }
Enclosure models a enclosure described by omreport.
type FanProbe ¶
type FanProbe struct { ID int `xml:"index,attr"` Reading float64 `xml:"ProbeReading"` Status Status `xml:"ProbeStatus"` Location string `xml:"ProbeLocation"` MinCriticalThreshold float64 `xml:"ProbeThresholds>LCThreshold"` MinNonCriticalThreshold float64 `xml:"ProbeThresholds>LNCThreshold"` }
FanProbe models a fan probe described by omreport.
type FirmwareEntry ¶
FirmwareEntry models a firmware entry described by omreport.
type Layout ¶
type Layout int
Layout models the layout of a RAID (e.g. RAID-0, RAID-1, RAID-10, etc.)
type OMReport ¶
type OMReport struct {
// contains filtered or unexported fields
}
OMReport implements OMReporter.
func NewOMReporter ¶
NewOMReporter returns a struct that implements OMReporter. Returns an error if the provided path to omcliproxy is potentially malicious and doesn't match known signatures.
func (*OMReport) About ¶
func (om *OMReport) About() (*AboutOutput, error)
About returns OMSA version information gathered from omreport.
func (*OMReport) Chassis ¶
func (om *OMReport) Chassis() (*ChassisOutput, error)
Chassis returns server chassis information gathered from omreport.
func (*OMReport) ChassisBatteries ¶
func (om *OMReport) ChassisBatteries() (*ChassisBatteriesOutput, error)
ChassisBatteries returns battery information gathered from omreport.
func (*OMReport) ChassisFans ¶
func (om *OMReport) ChassisFans() (*ChassisFansOutput, error)
ChassisFans returns fan information gathered from omreport.
func (*OMReport) ChassisInfo ¶
func (om *OMReport) ChassisInfo() (*ChassisInfoOutput, error)
ChassisInfo returns chassis information gathered from omreport.
func (*OMReport) ChassisMemory ¶
func (om *OMReport) ChassisMemory() (*ChassisMemoryOutput, error)
ChassisMemory returns memory information gathered from omreport.
func (*OMReport) ChassisPowerMonitoring ¶
func (om *OMReport) ChassisPowerMonitoring() (*ChassisPowerMonitoringOutput, error)
ChassisPowerMonitoring returns power monitoring information gathered from omreport.
func (*OMReport) ChassisPowerSupplies ¶
func (om *OMReport) ChassisPowerSupplies() (*ChassisPowerSuppliesOutput, error)
ChassisPowerSupplies returns power supply information gathered from omreport.
func (*OMReport) ChassisProcessors ¶
func (om *OMReport) ChassisProcessors() (*ChassisProcessorsOutput, error)
ChassisProcessors returns processor information gathered from omreport.
func (*OMReport) ChassisTemps ¶
func (om *OMReport) ChassisTemps() (*ChassisTempsOutput, error)
ChassisTemps returns temperature information gathered from omreport.
func (*OMReport) StorageController ¶
func (om *OMReport) StorageController() (*StorageControllerOutput, error)
StorageController returns RAID controller information gathered from omreport.
func (*OMReport) StorageEnclosure ¶
func (om *OMReport) StorageEnclosure() (*StorageEnclosureOutput, error)
StorageEnclosure returns storage enclosure information gathered from omreport.
func (*OMReport) StoragePDisk ¶
func (om *OMReport) StoragePDisk(cid int) (*StoragePDiskOutput, error)
StoragePDisk returns physical disk information associated with the provided storage controller gathered from omreport.
func (*OMReport) StorageVDisk ¶
func (om *OMReport) StorageVDisk() (*StorageVDiskOutput, error)
StorageVDisk returns virtual disk information gathered from omreport.
func (*OMReport) SuspiciousOMCLIProxyBinary ¶
SuspiciousOMCLIProxyBinary is a method that can be called by clients to check whether the configured omcliproxy binary is suspicious. The binary is considered suspicious if its sha256 checksum is different from the checksum computed when the omreport object was first instantiated using NewOMReporter. This implies that something has changed the the executable contents underneath this process and that further execution should proceed with caution. Returns a non-nil error if the binary is considered suspicious or if the file checksum cannot be calculated.
type OMReporter ¶
type OMReporter interface { Report(...string) ([]byte, error) Chassis() (*ChassisOutput, error) ChassisInfo() (*ChassisInfoOutput, error) ChassisBatteries() (*ChassisBatteriesOutput, error) ChassisFans() (*ChassisFansOutput, error) ChassisProcessors() (*ChassisProcessorsOutput, error) ChassisMemory() (*ChassisMemoryOutput, error) ChassisTemps() (*ChassisTempsOutput, error) ChassisPowerMonitoring() (*ChassisPowerMonitoringOutput, error) ChassisPowerSupplies() (*ChassisPowerSuppliesOutput, error) StorageController() (*StorageControllerOutput, error) StorageEnclosure() (*StorageEnclosureOutput, error) StorageVDisk() (*StorageVDiskOutput, error) StoragePDisk(cid int) (*StoragePDiskOutput, error) SuspiciousOMCLIProxyBinary() error }
An OMReporter gathers information from Dell's omreport utility.
type PDisk ¶
type PDisk struct { AttributesMask string `xml:"AttributesMask"` BusProtocol BusProtocol `xml:"BusProtocol"` ID int `xml:"DeviceID"` ControllerID int `xml:"ControllerNum"` EnclosureID int `xml:"EnclosureID"` PartNo string `xml:"PartNo"` ProductID string `xml:"ProductID"` SerialNo string `xml:"DeviceSerialNumber"` SlotNo int `xml:"EnclosureIndex"` Status Status `xml:"ObjStatus"` State State `xml:"ObjState"` Vendor string `xml:"Vendor"` }
PDisk models a physical disk described by omreport.
func (*PDisk) DedicatedHotSpare ¶
DedicatedHotSpare returns true if a physical disk is a dedicated hot spare. Returns an error if attribute cannot be determined.
func (*PDisk) FailurePredicted ¶
FailurePredicted returns true if a physical disk is in a failure predicted state. Returns an error if attribute cannot be determined.
func (*PDisk) GlobalHotSpare ¶
GlobalHotSpare returns true if a physical disk is a global hot spare. Returns an error if attribute cannot be determined.
type PowerProbe ¶
type PowerProbe struct { ID int `xml:"index,attr"` Name string `xml:"ProbeLocation"` Reading float64 `xml:"ProbeReading"` Status Status `xml:"ProbeStatus"` CriticalThreshold float64 `xml:"ProbeThresholds>UCThreshold"` WarningThreshold float64 `xml:"ProbeThresholds>UNCThreshold"` }
PowerProbe models a power consumption probe.
type PowerSupply ¶
type PowerSupply struct { ID int `xml:"index,attr"` InputRatedWatts float64 `xml:"InputRatedWatts"` FirmwareVersion string `xml:"FirmWareVersion"` PowerMonitoringCapable bool `xml:"PMCapable"` OutputWatts float64 `xml:"OutputWatts"` Location string `xml:"PSLocation"` State PowerSupplyState `xml:"PSState"` }
PowerSupply models a power supply described by omreport.
type PowerSupplyState ¶
type PowerSupplyState struct { PresenceDetected bool `xml:"PSPresenceDetected"` FailureDetected bool `xml:"PSFailureDetected"` PredictiveFailure bool `xml:"PSPredictiveFailure"` ACLost bool `xml:"PSACLost"` ACLostOrOutOfRange bool `xml:"PSACLostorOutofRange"` ACPresentOrOutOfRange bool `xml:"PSACPresentorOutofRange"` ConfigError bool `xml:"PSConfigError"` }
PowerSupplyState models the state of a power supply.
type Probe ¶
type Probe struct { ID int `xml:"instance,attr"` Name string `xml:"ProbeLocation"` MinCriticalThreshold float64 `xml:"probeThresholds>lcThreshold"` MinNonCriticalThreshold float64 `xml:"probeThresholds>lncThreshold"` MaxCriticalThreshold float64 `xml:"probeThresholds>ucThreshold"` MaxNonCriticalThreshold float64 `xml:"probeThresholds>uncThreshold"` Reading float64 `xml:"probeReading"` Status Status `xml:"objstatus"` }
Probe models a generic probe.
type Processor ¶
type Processor struct { ID int `xml:"index,attr"` Name string `xml:"DevProcessor>ExtName"` MaxSpeed float64 `xml:"DevProcessor>MaxSpeed"` CurrentSpeed float64 `xml:"DevProcessor>CurSpeed"` Manufacturer string `xml:"DevProcessor>Manufacturer"` Model string `xml:"DevProcessor>Brand"` PhysicalCores int `xml:"DevProcessor>CoreCount"` VirtualCores int `xml:"DevProcessor>ThreadCount"` Status Status `xml:"status,attr"` }
Processor models a CPU described by omreport.
type ProcessorProbe ¶
type ProcessorProbe struct { ID int `xml:"index,attr"` Location string `xml:"ProbeLocation"` InternalError bool `xml:"ProcessorStatus>CPUStatusIErr"` ThermTrip bool `xml:"ProcessorStatus>CPUStatusThermTrip"` ConfigError bool `xml:"ProcessorStatus>CPUStatusConfigErr"` PresenceDetected bool `xml:"ProcessorStatus>CPUStatusPresenceDetected"` Disabled bool `xml:"ProcessorStatus>CPUStatusDisabled"` TermPresenceDetected bool `xml:"ProcessorStatus>CPUStatusTermPresenceDetected"` Throttled bool `xml:"ProcessorStatus>CPUStatusThrottled"` }
ProcessorProbe models a CPU probe described by omreport.
type State ¶
type State int
State models the state of a hardware component (e.g. Ready, Degraded, Failed, etc.)
type Status ¶
type Status int
Status models the status of a hardware component (e.g. OK, Critical, NonCritical).
type StorageControllerOutput ¶
type StorageControllerOutput struct {
Controllers []Controller `xml:"Controllers>DCStorageObject"`
}
StorageControllerOutput models the output of 'omreport storage controller'.
type StorageEnclosureOutput ¶
type StorageEnclosureOutput struct {
Enclosures []Enclosure `xml:"Enclosures>DCStorageObject"`
}
StorageEnclosureOutput models the output of 'omreport storage enclosure'.
type StoragePDiskOutput ¶
type StoragePDiskOutput struct {
PDisks []PDisk `xml:"ArrayDisks>DCStorageObject"`
}
StoragePDiskOutput models the output of 'omreport storage pdisk controller=<ID>'.
type StorageVDiskOutput ¶
type StorageVDiskOutput struct {
VDisks []VDisk `xml:"VirtualDisks>DCStorageObject"`
}
StorageVDiskOutput models the output of 'omreport storage vdisk'.
type TemperatureProbe ¶
type TemperatureProbe struct { ID int `xml:"index,attr"` Reading float64 `xml:"ProbeReading"` Status Status `xml:"ProbeStatus"` Location string `xml:"ProbeLocation"` }
TemperatureProbe models a temperature probe described by omreport.
type VDisk ¶
type VDisk struct { ID int `xml:"DeviceID"` BusProtocol BusProtocol `xml:"BusProtocol"` Name string `xml:"Name"` DeviceName string `xml:"DeviceName"` Layout Layout `xml:"Layout"` State State `xml:"ObjState"` Status Status `xml:"ObjStatus"` Size int `xml:"Length"` }
VDisk models a virtual disk described by omreport.