partially working. Some datapoints are failing with panic and are silently ignored.

TODO must fix.
This commit is contained in:
Jason Kulatunga
2022-05-03 22:40:31 -07:00
parent 7d963c96a6
commit 8fe0dbed6b
5 changed files with 482 additions and 109 deletions
@@ -29,3 +29,19 @@ type Device struct {
DeviceType string `json:"device_type"` //device type is used for querying with -d/t flag, should only be used by collector.
SmartResults []Smart `gorm:"foreignkey:DeviceWWN" json:"smart_results"`
}
const DeviceProtocolAta = "ATA"
const DeviceProtocolScsi = "SCSI"
const DeviceProtocolNvme = "NVMe"
func (dv *Device) IsAta() bool {
return dv.DeviceProtocol == DeviceProtocolAta
}
func (dv *Device) IsScsi() bool {
return dv.DeviceProtocol == DeviceProtocolScsi
}
func (dv *Device) IsNvme() bool {
return dv.DeviceProtocol == DeviceProtocolNvme
}