b44ef5cb9c
/scrutiny/config/collector.yaml Adding ability to specify host identifier (label), that is updated on every collector run. Can be specified by `host-id` CLI or `COLLECTOR_HOST_ID` env var. Created a config class, interface and associated tests. Created a "TransformDetectedDrives" function, that will allow users to insert drives not detected by Smarctl --scan, ignore drives that they dont want, and override smartctl device type. Added Upsert functionality when registering devices. Replaced "github.com/jinzhu/gorm" with "gorm.io/gorm" (ORM location moved, was using incorrect lib url) Removed machineid library.
27 lines
1009 B
Go
27 lines
1009 B
Go
package models
|
|
|
|
type Device struct {
|
|
WWN string `json:"wwn"`
|
|
HostId string `json:"host_id"`
|
|
|
|
DeviceName string `json:"device_name"`
|
|
Manufacturer string `json:"manufacturer"`
|
|
ModelName string `json:"model_name"`
|
|
InterfaceType string `json:"interface_type"`
|
|
InterfaceSpeed string `json:"interface_speed"`
|
|
SerialNumber string `json:"serial_number"`
|
|
Firmware string `json:"firmware"`
|
|
RotationSpeed int `json:"rotational_speed"`
|
|
Capacity int64 `json:"capacity"`
|
|
FormFactor string `json:"form_factor"`
|
|
SmartSupport bool `json:"smart_support"`
|
|
DeviceProtocol string `json:"device_protocol"` //protocol determines which smart attribute types are available (ATA, NVMe, SCSI)
|
|
DeviceType string `json:"device_type"` //device type is used for querying with -d/t flag, should only be used by collector.
|
|
}
|
|
|
|
type DeviceWrapper struct {
|
|
Success bool `json:"success,omitempty"`
|
|
Errors []error `json:"errors,omitempty"`
|
|
Data []Device `json:"data"`
|
|
}
|