Versions in this module Expand all Collapse all v0 v0.5.1 Oct 10, 2024 Changes in this version + const BitsInt64 + const BitsUint8 + const DSUExitCodeNoUpdatesAvailable + const DSUExitCodeRebootRequired + const DSUExitCodeUpdatesApplied + const DellRacadmPath + const EnvAsrrBiosUtility + const EnvAsrrKernelModule + const EnvBlkdiscardUtility + const EnvDellDSURelease + const EnvDellDSUVersion + const EnvDmidecodeUtility + const EnvDnfUtility + const EnvDsuUtility + const EnvFlashromUtility + const EnvHdparmUtility + const EnvLsblkUtility + const EnvLshwUtility + const EnvMlxupUtility + const EnvMsecliUtility + const EnvMvcliUtility + const EnvNvmeUtility + const EnvSmartctlUtility + const EnvSmcIpmicfgUtility + const EnvStorecliUtility + const EnvUefiFirmwareParserUtility + const EnvVarRacadm7 + const EnvVarSumPath + const LocalUpdatesDirectory + const LsblkUtility + const UefiFirmwareParserUtility + const UefiVariableCollectorUtility + var DellRepoTemplate = ... + var ErrASRRBIOSKernelModule = errors.New("error loading asrr bios kernel module") + var ErrCreateVirtualDisk = errors.New("failed to create virtual disk") + var ErrDellBiosCfgFileEmpty = errors.New("BIOS config file empty or invalid") + var ErrDellBiosCfgFileUndefined = errors.New("no BIOS config file defined") + var ErrDellBiosCfgNil = errors.New("expected valid bios config object, got nil") + var ErrDestroyVirtualDisk = errors.New("failed to destroy virtual disk") + var ErrDsuInventoryCollectorBinMissing = errors.New("dsu inventory collector executable missing 'invcol_*_*.BIN'") + var ErrDsuUpdatesDirectoryMissing = errors.New("dsu updates directory missing") + var ErrDsuVersionQuery = errors.New("dsu version query error") + var ErrFakeExecutorInvalidArgs = errors.New("invalid number of args passed to fake executor") + var ErrIneffectiveWipe = errors.New("found left over data after wiping disk") + var ErrInvalidBlockSize = errors.New("invalid block size") + var ErrInvalidInfoType = errors.New("invalid info type") + var ErrInvalidInitMode = errors.New("invalid init mode") + var ErrInvalidRaidMode = errors.New("invalid raid mode") + var ErrInvalidVirtualDiskID = errors.New("invalid virtual disk id") + var ErrLsblkTransportUnsupported = errors.New("Unsupported transport type") + var ErrMseCliDriveNotIdentified = errors.New("failed to identify drive for update") + var ErrMultipleDsuInventoryCollectorBins = errors.New("multiple inventory collector bins found") + var ErrNoCommandOutput = errors.New("command returned no output") + var ErrParseLshwOutput = errors.New("lshw output parse error") + var ErrRebootRequired = errors.New("reboot required") + var ErrRepositoryBaseURL = errors.New(...) + var ErrVersionStrExpectedSemver = errors.New("expected version string to follow semver format") + func ApplyWatermarks(drive *common.Drive) (func() error, error) + func CreateVirtualDiskError(createStdout []byte) error + func DestroyVirtualDiskError(destroyStdout []byte) error + func InvalidBlockSizeError(blockSize uint) error + func InvalidInfoTypeError(infoType string) error + func InvalidInitModeError(initMode string) error + func InvalidRaidModeError(raidMode string) error + func InvalidVirtualDiskIDError(virtualDiskID int) error + type AsrrBioscontrol struct + Executor Executor + func NewAsrrBioscontrol(trace bool) *AsrrBioscontrol + func (a *AsrrBioscontrol) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (a *AsrrBioscontrol) GetBIOSConfiguration(ctx context.Context, _ string) (map[string]string, error) + type Blkdiscard struct + Executor Executor + func NewBlkdiscardCmd(trace bool) *Blkdiscard + func NewFakeBlkdiscard() *Blkdiscard + func (b *Blkdiscard) Discard(ctx context.Context, drive *common.Drive) error + func (b *Blkdiscard) WipeDrive(ctx context.Context, logger *logrus.Logger, drive *common.Drive) error + type CommandStatus struct + Description string + Status string + type Controller struct + CommandStatus *CommandStatus + ResponseData *ResponseData + type DellRacadm struct + BIOSCfgTmpFile string + ConfigJSON string + Executor Executor + KeepConfigFile bool + func NewDellRacadm(trace bool) *DellRacadm + func NewFakeRacadm(biosCfgFile string) *DellRacadm + func (s *DellRacadm) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (s *DellRacadm) GetBIOSConfiguration(ctx context.Context, deviceModel string) (map[string]string, error) + type DeviceIdentifiers struct + Model string + Serial string + Vendor string + func IdentifyVendorModel(dmidecode *Dmidecode) (*DeviceIdentifiers, error) + type Dmidecode struct + func InitFakeDmidecode(testFile string) (*Dmidecode, error) + func NewDmidecode() (d *Dmidecode, err error) + func (d *Dmidecode) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (d *Dmidecode) BIOSVersion() (string, error) + func (d *Dmidecode) BaseBoardManufacturer() (string, error) + func (d *Dmidecode) BaseBoardProductName() (string, error) + func (d *Dmidecode) BaseBoardSerialNumber() (string, error) + func (d *Dmidecode) ChassisSerialNumber() (string, error) + func (d *Dmidecode) Manufacturer() (string, error) + func (d *Dmidecode) ProductName() (string, error) + func (d *Dmidecode) SerialNumber() (string, error) + func (d *Dmidecode) TPMs(context.Context) ([]*common.TPM, error) + type Dnf struct + Executor Executor + func NewDnf(trace bool) *Dnf + func NewFakeDnf() *Dnf + func (d *Dnf) AddRepo(path string, params *DnfRepoParams, _ []byte) (err error) + func (d *Dnf) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (d *Dnf) Install(pkgNames []string) (err error) + type DnfRepoParams struct + BaseURL string + GPGCheck bool + Name string + RepoVersion string + type Dsu struct + Executor Executor + func NewDsu(trace bool) *Dsu + func NewFakeDsu(r io.Reader) (*Dsu, error) + func (d *Dsu) ApplyLocalUpdates(ctx context.Context, updateDir string) (int, error) + func (d *Dsu) ApplyUpdates() (int, error) + func (d *Dsu) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (d *Dsu) ComponentFirmwareUpdatePreview(ctx context.Context) ([]*model.Component, int, error) + func (d *Dsu) FetchUpdateFiles(ctx context.Context, dstDir string) (int, error) + func (d *Dsu) Inventory(ctx context.Context) ([]*model.Component, error) + func (d *Dsu) Version() (string, error) + type ExecError struct + Cmd string + ExitCode int + Stderr string + Stdout string + func (u *ExecError) Error() string + type Execute struct + Args []string + CheckBin bool + Cmd string + Env []string + Quiet bool + Stdin io.Reader + func (e *Execute) CheckExecutable() error + func (e *Execute) CmdPath() string + func (e *Execute) DisableBinCheck() + func (e *Execute) Exec(ctx context.Context) (result *Result, err error) + func (e *Execute) GetCmd() string + func (e *Execute) SetArgs(a ...string) + func (e *Execute) SetEnv(env []string) + func (e *Execute) SetExitCode(_ int) + func (e *Execute) SetQuiet() + func (e *Execute) SetStderr(_ []byte) + func (e *Execute) SetStdin(r io.Reader) + func (e *Execute) SetStdout(_ []byte) + func (e *Execute) SetVerbose() + type Executor interface + CheckExecutable func() error + CmdPath func() string + DisableBinCheck func() + Exec func(context.Context) (*Result, error) + GetCmd func() string + SetArgs func(...string) + SetEnv func([]string) + SetExitCode func(int) + SetQuiet func() + SetStderr func([]byte) + SetStdin func(io.Reader) + SetStdout func([]byte) + SetVerbose func() + func NewExecutor(cmd string) Executor + func NewFakeExecutor(cmd string) Executor + func NewFakeLshwExecutor(cmd string) Executor + func NewFakeRacadmExecutor(cmd string) Executor + func NewFakeSMCSumExecutor(cmd string) Executor + func NewFakeSmartctlExecutor(cmd, dir string) Executor + type FakeExecute struct + Args []string + CheckBin bool + Cmd string + Env []string + ExitCode int + Quiet bool + Stderr []byte + Stdin io.Reader + Stdout []byte + func (e *FakeExecute) CheckExecutable() error + func (e *FakeExecute) CmdPath() string + func (e *FakeExecute) DisableBinCheck() + func (e *FakeExecute) Exec(_ context.Context) (*Result, error) + func (e *FakeExecute) GetCmd() string + func (e *FakeExecute) SetArgs(a ...string) + func (e *FakeExecute) SetEnv(env []string) + func (e *FakeExecute) SetExitCode(i int) + func (e *FakeExecute) SetQuiet() + func (e *FakeExecute) SetStderr(b []byte) + func (e *FakeExecute) SetStdin(r io.Reader) + func (e *FakeExecute) SetStdout(b []byte) + func (e *FakeExecute) SetVerbose() + type FakeLshwExecute struct + Args []string + Cmd string + Env []string + Quiet bool + Stderr []byte + Stdin io.Reader + Stdout []byte + func (e *FakeLshwExecute) Exec(context.Context) (*Result, error) + func (e *FakeLshwExecute) SetArgs(a ...string) + func (e *FakeLshwExecute) SetStdin(r io.Reader) + type FakeRacadmExecute struct + Args []string + Cmd string + Env []string + Quiet bool + Stderr []byte + Stdin io.Reader + Stdout []byte + func (e *FakeRacadmExecute) Exec(context.Context) (*Result, error) + func (e *FakeRacadmExecute) SetArgs(a ...string) + type FakeSMCSumExecute struct + Args []string + Cmd string + Env []string + Quiet bool + Stderr []byte + Stdin io.Reader + Stdout []byte + func (e *FakeSMCSumExecute) Exec(_ context.Context) (*Result, error) + func (e *FakeSMCSumExecute) GetCmd() string + func (e *FakeSMCSumExecute) SetArgs(a ...string) + func (e *FakeSMCSumExecute) SetStdin(r io.Reader) + type FakeSmartctlExecute struct + Args []string + CheckBin bool + Cmd string + Env []string + ExitCode int + JSONFilesDir string + Quiet bool + Stderr []byte + Stdin io.Reader + Stdout []byte + func (e *FakeSmartctlExecute) CheckExecutable() error + func (e *FakeSmartctlExecute) CmdPath() string + func (e *FakeSmartctlExecute) Exec(context.Context) (*Result, error) + func (e *FakeSmartctlExecute) SetArgs(a ...string) + func (e *FakeSmartctlExecute) SetExitCode(i int) + func (e *FakeSmartctlExecute) SetStdin(r io.Reader) + type FillZero struct + Quiet bool + func NewFillZeroCmd(trace bool) *FillZero + func (z *FillZero) SetQuiet() + func (z *FillZero) WipeDrive(ctx context.Context, logger *logrus.Logger, drive *common.Drive) error + type Flashrom struct + Executor Executor + func NewFlashromCmd(trace bool) *Flashrom + func (f *Flashrom) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (f *Flashrom) WriteBIOSImage(ctx context.Context, path string) error + type Hdparm struct + Executor Executor + func NewFakeHdparm() *Hdparm + func NewHdparmCmd(trace bool) *Hdparm + func (h *Hdparm) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (h *Hdparm) DriveCapabilities(ctx context.Context, logicalName string) ([]*common.Capability, error) + func (h *Hdparm) Erase(ctx context.Context, drive *common.Drive, ses SecureEraseSetting) error + func (h *Hdparm) Sanitize(ctx context.Context, drive *common.Drive, sanact SanitizeAction) error + func (h *Hdparm) WipeDrive(ctx context.Context, logger *logrus.Logger, drive *common.Drive) error + type Ipmicfg struct + Executor Executor + func NewFakeIpmicfg(r io.Reader) *Ipmicfg + func NewIpmicfgCmd(trace bool) *Ipmicfg + func (i *Ipmicfg) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (i *Ipmicfg) BIOS(ctx context.Context) (*common.BIOS, error) + func (i *Ipmicfg) Summary(ctx context.Context) (*IpmicfgSummary, error) + func (i Ipmicfg) BMC(ctx context.Context) (*common.BMC, error) + func (i Ipmicfg) CPLDs(ctx context.Context) ([]*common.CPLD, error) + type IpmicfgSummary struct + BIOSBuildDate string + BIOSVersion string + CPLDVersion string + FirmwareBuildDate string + FirmwareRevision string + type Lsblk struct + Executor Executor + func NewFakeLsblk() *Lsblk + func NewLsblkCmd(trace bool) *Lsblk + func (l *Lsblk) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (l *Lsblk) Drives(ctx context.Context) ([]*common.Drive, error) + type Lshw struct + Device *common.Device + Executor Executor + func NewFakeLshw(stdin io.Reader) *Lshw + func NewLshwCmd(trace bool) *Lshw + func (l *Lshw) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (l *Lshw) Collect(ctx context.Context, device *common.Device) error + func (l *Lshw) ListJSON(ctx context.Context) (*LshwOutput, error) + type LshwNode struct + Businfo string + Capabilities LshwNodeCapabilities + Capacity int64 + ChildNodes []*LshwNode + Claimed bool + Class string + Clock int64 + Configuration LshwNodeConfiguration + Description string + Dev string + Handle string + ID string + LogicalName interface{} + Physid string + Product string + Serial string + Size float64 + Slot string + Units string + Vendor string + Version string + Width int + type LshwNodeCapabilities map[string]interface + type LshwNodeConfiguration map[string]string + type LshwOutput []*LshwNode + type Mlxup struct + Executor Executor + func NewFakeMlxup(r io.Reader) (*Mlxup, error) + func NewMlxupCmd(trace bool) *Mlxup + func (m *Mlxup) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (m *Mlxup) NICs(ctx context.Context) ([]*common.NIC, error) + func (m *Mlxup) Query(ctx context.Context) ([]*MlxupDevice, error) + func (m *Mlxup) UpdateNIC(ctx context.Context, updateFile, modelNumber string, force bool) error + func (m *Mlxup) UpdateRequirements(_ string) *model.UpdateRequirements + type MlxupDevice struct + BaseMAC string + Description string + DeviceType string + Firmware []string + FirmwarePXE []string + FirmwareUEFI []string + PCIDeviceName string + PSID string + PartNumber string + Status string + type Msecli struct + Executor Executor + func NewMsecli(trace bool) *Msecli + func (m *Msecli) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (m *Msecli) Drives(ctx context.Context) ([]*common.Drive, error) + func (m *Msecli) Query(ctx context.Context) ([]*MsecliDevice, error) + func (m *Msecli) UpdateDrive(ctx context.Context, updateFile, modelNumber, serialNumber string) error + type MsecliDevice struct + FirmwareRevision string + ModelNumber string + SerialNumber string + type Mvcli struct + Executor Executor + func NewFakeMvcli(r io.Reader) (*Mvcli, error) + func NewMvcliCmd(trace bool) *Mvcli + func (m *Mvcli) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (m *Mvcli) Create(ctx context.Context, physicalDiskIDs []uint, raidMode, name string, ...) error + func (m *Mvcli) CreateVirtualDisk(ctx context.Context, raidMode string, physicalDisks []uint, name string, ...) error + func (m *Mvcli) Destroy(ctx context.Context, virtualDiskID int) error + func (m *Mvcli) DestroyVirtualDisk(ctx context.Context, virtualDiskID int) error + func (m *Mvcli) Drives(ctx context.Context) ([]*common.Drive, error) + func (m *Mvcli) FindVdBy(ctx context.Context, k string, v interface{}) *MvcliDevice + func (m *Mvcli) FindVdByID(ctx context.Context, virtualDiskID int) *MvcliDevice + func (m *Mvcli) FindVdByName(ctx context.Context, name string) *MvcliDevice + func (m *Mvcli) Info(ctx context.Context, infoType string) ([]*MvcliDevice, error) + func (m *Mvcli) StorageControllers(ctx context.Context) ([]*common.StorageController, error) + func (m *Mvcli) VirtualDisks(ctx context.Context) ([]*MvcliDevice, error) + type MvcliDevice struct + AdapterID int + CurrentSpeed int64 + Firmware string + FirmwareBios string + FirmwareBootLoader string + FirmwareRom string + ID int + Model string + Name string + PDSize int64 + Product string + SSDType string + Serial string + Size int64 + Status string + SubProduct string + SupportedRAIDModes string + Type string + type Nvme struct + Executor Executor + func NewFakeNvme() *Nvme + func NewNvmeCmd(trace bool) *Nvme + func (n *Nvme) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (n *Nvme) DriveCapabilities(ctx context.Context, logicalName string) ([]*common.Capability, error) + func (n *Nvme) Drives(ctx context.Context) ([]*common.Drive, error) + func (n *Nvme) Format(ctx context.Context, drive *common.Drive, ses SecureEraseSetting) error + func (n *Nvme) ResetNS(ctx context.Context, logicalName string) error + func (n *Nvme) Sanitize(ctx context.Context, drive *common.Drive, sanact SanitizeAction) error + func (n *Nvme) WipeDrive(ctx context.Context, logger *logrus.Logger, drive *common.Drive) error + type ResponseData struct + BIOSVersion string + FirmwareVersion string + PhysicalDrives int + ProductName string + SerialNumber string + type Result struct + ExitCode int + Stderr []byte + Stdout []byte + type SanitizeAction uint8 + const BlockErase + const CryptoErase + const ExitFailureMode + const Invalid + const Overwrite + func (i SanitizeAction) String() string + type SecureEraseSetting uint8 + const CryptographicErase + const None + const Reserved + const UserDataErase + func (i SecureEraseSetting) String() string + type ShowController struct + Controllers []*Controller + type Smartctl struct + Executor Executor + func NewFakeSmartctl(dataDir string) *Smartctl + func NewSmartctlCmd(trace bool) *Smartctl + func (s *Smartctl) All(ctx context.Context, device string) (*SmartctlDriveAttributes, error) + func (s *Smartctl) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (s *Smartctl) Drives(ctx context.Context) ([]*common.Drive, error) + func (s *Smartctl) Scan(ctx context.Context) (*SmartctlScan, error) + type SmartctlDrive struct + Name string + Protocol string + Type string + type SmartctlDriveAttributes struct + Errors []string + FirmwareVersion string + ModelFamily string + ModelName string + OemProductID string + SerialNumber string + Status *SmartctlStatus + type SmartctlScan struct + Drives []*SmartctlDrive + type SmartctlStatus struct + Passed bool + type StoreCLI struct + Executor Executor + func NewFakeStoreCLI(r io.Reader) (*StoreCLI, error) + func NewStoreCLICmd(trace bool) *StoreCLI + func (s *StoreCLI) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (s *StoreCLI) ShowController0(ctx context.Context) ([]byte, error) + func (s *StoreCLI) StorageControllers(ctx context.Context) ([]*common.StorageController, error) + type SupermicroSUM struct + Executor Executor + func NewFakeSMCIpmiCfg() *SupermicroSUM + func NewFakeSMCSum(stdin io.Reader) *SupermicroSUM + func NewSupermicroSUM(trace bool) *SupermicroSUM + func (s *SupermicroSUM) ApplyUpdate(ctx context.Context, updateFile, componentSlug string) error + func (s *SupermicroSUM) Attributes() (utilName model.CollectorUtility, absolutePath string, err error) + func (s *SupermicroSUM) Collect(_ *common.Device) error + func (s *SupermicroSUM) Components() ([]*model.Component, error) + func (s *SupermicroSUM) GetBIOSConfiguration(ctx context.Context, _ string) (map[string]string, error) + func (s *SupermicroSUM) UpdateBIOS(ctx context.Context, updateFile, modelNumber string) error + func (s *SupermicroSUM) UpdateBMC(ctx context.Context, updateFile, _ string) error + type UEFIVarEntry struct + Error bool + Path string + Sha256sum string + Size int64 + type UEFIVariableCollector struct + func (UEFIVariableCollector) Attributes() (model.CollectorUtility, string, error) + func (UEFIVariableCollector) GetUEFIVars(ctx context.Context) (UEFIVars, error) + type UEFIVars map[string]UEFIVarEntry + type UefiFirmwareParser struct + Executor Executor + func NewUefiFirmwareParserCmd(trace bool) *UefiFirmwareParser + func (u *UefiFirmwareParser) Attributes() (model.CollectorUtility, string, error) + func (u *UefiFirmwareParser) ExtractLogo(ctx context.Context, outputPath, biosImg string) error