alerts

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package alerts handles alert management and delivery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUserAlerts

func DeleteUserAlerts(e *core.RequestEvent) error

DeleteUserAlerts handles API request to delete alerts for a user across multiple systems (DELETE /api/beszel/user-alerts)

func UpsertUserAlerts

func UpsertUserAlerts(e *core.RequestEvent) error

UpsertUserAlerts handles API request to create or update alerts for a user across multiple systems (POST /api/beszel/user-alerts)

Types

type AlertManager

type AlertManager struct {
	// contains filtered or unexported fields
}

func NewAlertManager

func NewAlertManager(app hubLike) *AlertManager

NewAlertManager creates a new AlertManager instance.

func (*AlertManager) HandleStatusAlerts

func (am *AlertManager) HandleStatusAlerts(newStatus string, systemRecord *core.Record) error

HandleStatusAlerts manages the logic when system status changes.

func (*AlertManager) HandleSystemAlerts

func (am *AlertManager) HandleSystemAlerts(systemRecord *core.Record, data *system.CombinedData) error

func (*AlertManager) IsNotificationSilenced added in v0.17.0

func (am *AlertManager) IsNotificationSilenced(userID, systemID string) bool

IsNotificationSilenced checks if a notification should be silenced based on configured quiet hours

func (*AlertManager) SendAlert

func (am *AlertManager) SendAlert(data AlertMessageData) error

SendAlert sends an alert to the user

func (*AlertManager) SendShoutrrrAlert

func (am *AlertManager) SendShoutrrrAlert(notificationUrl, title, message, link, linkText string) error

SendShoutrrrAlert sends an alert via a Shoutrrr URL

func (*AlertManager) SendTestNotification

func (am *AlertManager) SendTestNotification(e *core.RequestEvent) error

func (*AlertManager) StopWorker

func (am *AlertManager) StopWorker()

StopWorker shuts down the AlertManager.worker goroutine

type AlertMessageData

type AlertMessageData struct {
	UserID   string
	SystemID string
	Title    string
	Message  string
	Link     string
	LinkText string
}

type SystemAlertData

type SystemAlertData struct {
	// contains filtered or unexported fields
}

type SystemAlertGPUData added in v0.16.0

type SystemAlertGPUData struct {
	Usage float64 `json:"u"`
}

type SystemAlertStats

type SystemAlertStats struct {
	Cpu          float64                       `json:"cpu"`
	Mem          float64                       `json:"mp"`
	Disk         float64                       `json:"dp"`
	NetSent      float64                       `json:"ns"`
	NetRecv      float64                       `json:"nr"`
	GPU          map[string]SystemAlertGPUData `json:"g"`
	Temperatures map[string]float32            `json:"t"`
	LoadAvg      [3]float64                    `json:"la"`
	Battery      [2]uint8                      `json:"bat"`
}

type UserNotificationSettings

type UserNotificationSettings struct {
	Emails   []string `json:"emails"`
	Webhooks []string `json:"webhooks"`
}

Jump to

Keyboard shortcuts

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