ipmimon

package
v0.0.0-...-c338937 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ipmimon provides interface to IPMI monitoing

Index

Constants

View Source
const (
	TypePowerSupply = "Power Supply"
	TypePowerUnit   = "Power Unit"
)
View Source
const (
	StateNominal  = "Nominal"
	StateWarning  = "Warning"
	StateCritical = "Critical"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID      int    `csv:"ID" json:"id"`
	Name    string `csv:"Name" json:"name"`
	Type    string `csv:"Type" json:"type"`
	State   string `csv:"State" json:"state"`
	Reading string `csv:"Reading" json:"reading"`
	Units   string `csv:"Units" json:"units"`
	Event   string `csv:"Event" json:"event"`
}

Item represents one line from the report

ipmimonitoring --comma-separated-output | head -n1
ID,Name,Type,State,Reading,Units,Event

func (*Item) Events

func (it *Item) Events() []string

type Report

type Report []Item

Report represent parsed report

func GetReport

func GetReport(ctx context.Context) (Report, error)

GetReport run ipmimonitoring and parse report

func ParseCSV

func ParseCSV(data []byte) (Report, error)

ParseCSV parses report csv into Report

func (Report) Filter

func (report Report) Filter(testFunc func(*Item) bool) Report

func (Report) Type

func (report Report) Type(typ string) Report

Jump to

Keyboard shortcuts

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