notify

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotComm

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

BotComm - messages via the BotComm message API.

type Discord

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

Discord - incoming webhook (https://discord.com/developers/docs/resources/webhook#execute-webhook)

type Mattermost

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

Mattermost - Slack-compatible incoming webhook. Works with Mattermost, Rocket.Chat and any other service accepting the Slack webhook payload.

type Notify

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

Notify - fan-out of the status notifications to the configured channels.

func New

func New(cfg *types.Cfg) (*Notify, error)

func (*Notify) Send

func (n *Notify) Send(host *types.Host, status types.StatusType) error

Send - notifies about a new host status. The channels are filtered by the host alerts list (empty list means all channels). Every channel is tried even if a previous one failed; the errors are joined. Identical notifications sent within the cooldown window are suppressed.

func (*Notify) Set

func (n *Notify) Set(clients []string, status types.StatusType, name, addr string) error

Set - sends a custom status notification for the given name/address.

func (*Notify) Shutdown

func (n *Notify) Shutdown()

Shutdown - sends the "offline" message to every channel (if enabled).

func (*Notify) Startup

func (n *Notify) Startup()

Startup - sends the "online" message to every channel (if enabled). Must be called once per process, not on every configuration reload.

type Ntfy

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

Ntfy - push notifications via ntfy.sh or a self-hosted ntfy server. The JSON publishing endpoint is used, so non-ASCII titles are supported.

type Pushover

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

Pushover - push notifications via pushover.net (https://pushover.net/api)

type SMTP

type SMTP struct {
	Host     string
	Port     int
	Username string
	Password string
	From     string
	To       []string

	InsecureSkipVerify bool
	// contains filtered or unexported fields
}

type Slack

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

type Teams

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

Teams - Microsoft Teams incoming webhook. The message is an Adaptive Card, accepted by both the Workflows webhooks and the legacy Office 365 connectors.

type Telegram

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

type Twilio

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

Twilio - SMS via the Twilio Messages API (https://www.twilio.com/docs/messaging/api/message-resource#create-a-message-resource)

type Webhook

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

Webhook - generic HTTP webhook. Every notification is delivered as a JSON document:

{
  "id": "<event id>", "type": "host", "subject": "...", "status": "down",
  "host": {"id": "...", "name": "...", "url": "...", "group": "..."},
  "timestamp": "2006-01-02T15:04:05Z"
}

The system messages (online/offline) have "type": "system" and a "message" field.

Jump to

Keyboard shortcuts

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