Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoMetric = errors.New("no Metrics exist in this device")
ErrNoMetric specifies that no metrics were found for a given Sensor. This is meant to be a soft error if needed, as the slapdash nature of hwmon sysfs files means that we can see *_label files with no corresponding metrics, and so on
var FanSensor = SensorType{/* contains filtered or unexported fields */}
FanSensor is the prefix for fan sensors
var TempSensor = SensorType{/* contains filtered or unexported fields */}
TempSensor is the string prefix for a temp sensor
var VoltSensor = SensorType{/* contains filtered or unexported fields */}
VoltSensor is the prefix for voltage sensors
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { // Name is the specified hwmon label for the directory Name string // AbsPath is the absolute path to the monitoring directory, usually linked as /sys/class/hwmon/hwmon* AbsPath string //Sensors are the individual metrics connected to a device Sensors []Sensor }
Device represents a single sensor chip, usually exposed as /sys/class/hwmon/hwmon*
type MonData ¶
type MonData map[string]SensorMetrics
MonData is a simple wrapper type for the map returned by ReportSensors
func ReportSensors ¶
ReportSensors returns the metrics from all the known sensors.
type Sensor ¶
type Sensor struct { DevType SensorType // SensorNum is the numerical ID of the sensor, i.e temp7_* SensorNum int64 }
Sensor is used to track a single hwmon chip metric
type SensorMetrics ¶
type SensorMetrics struct { //Generic Fields Label string `struct:"label,omitempty"` Critical opt.Uint `struct:"critical,omitempty"` Max opt.Uint `struct:"max,omitempty"` Lowest opt.Uint `struct:"lowest,omitempty"` Average opt.Uint `struct:"average,omitempty"` // The input value of the metric. The key is overridden and set to the value of sensorType by Fold() Value opt.Uint `struct:"value,omitempty"` // contains filtered or unexported fields }
SensorMetrics reports the actual metrics in a sensor This is meant to be generic for all possible sensor types.
func (*SensorMetrics) Fold ¶
func (sm *SensorMetrics) Fold(v structform.ExtVisitor) error
Fold implements the Folder interface for structform This is entirely so we can carry around a relatively simple struct that transforms into the more heavily nested event that's the standard for beats events.
type SensorType ¶
type SensorType struct {
// contains filtered or unexported fields
}
SensorType is for the string prefix of the sensor files