Documentation
¶
Index ¶
- Constants
- func ShouldNotify(device models.Device, smartAttrs measurements.Smart, notifyLevel string, ...) bool
- type Notify
- func (n *Notify) GenShoutrrrNotificationParams(shoutrrrUrl string) (string, *shoutrrrTypes.Params, error)
- func (n *Notify) Send() error
- func (n *Notify) SendScriptNotification(scriptUrl string) error
- func (n *Notify) SendShoutrrrNotification(shoutrrrUrl string) error
- func (n *Notify) SendWebhookNotification(webhookUrl string) error
- type Payload
Constants ¶
View Source
const NotifyFailureTypeBothFailure = "SmartFailure" //SmartFailure always takes precedence when Scrutiny & Smart failed.
View Source
const NotifyFailureTypeEmailTest = "EmailTest"
View Source
const NotifyFailureTypeScrutinyFailure = "ScrutinyFailure"
View Source
const NotifyFailureTypeSmartFailure = "SmartFailure"
Variables ¶
This section is empty.
Functions ¶
func ShouldNotify ¶ added in v0.4.14
func ShouldNotify(device models.Device, smartAttrs measurements.Smart, notifyLevel string, notifyFilterAttributes string) bool
ShouldNotify check if the error Message should be filtered (level mismatch or filtered_attributes)
Types ¶
type Notify ¶
type Notify struct { Logger logrus.FieldLogger Config config.Interface Payload Payload }
func (*Notify) GenShoutrrrNotificationParams ¶
func (*Notify) SendScriptNotification ¶
func (*Notify) SendShoutrrrNotification ¶
func (*Notify) SendWebhookNotification ¶
type Payload ¶
type Payload struct { DeviceType string `json:"device_type"` //ATA/SCSI/NVMe DeviceName string `json:"device_name"` //dev/sda DeviceSerial string `json:"device_serial"` //WDDJ324KSO Test bool `json:"test"` // false //private, populated during init (marked as Public for JSON serialization) Date string `json:"date"` //populated by Send function. FailureType string `json:"failure_type"` //EmailTest, BothFail, SmartFail, ScrutinyFail Subject string `json:"subject"` Message string `json:"message"` }
TODO: include host and/or user label for device.
func (*Payload) GenerateFailureType ¶ added in v0.4.14
func (p *Payload) GenerateFailureType(deviceStatus pkg.DeviceStatus) string
func (*Payload) GenerateMessage ¶
func (*Payload) GenerateSubject ¶
Click to show internal directories.
Click to hide internal directories.