trigger

package
v0.0.1-dev-1a91f0a Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Triggers = "triggers"
)

Variables

View Source
var DefaultOptions = []Options{
	{
		Name:        "Administrative Level Notification",
		Description: `Configure how you are going to be notified for system events and host alerts, including levels "warning", "error", and "critical".`,
		Match:       `"severity" == 'W' OR "severity" == 'E' OR "severity" == 'C'`,
		Attributes: []Attribute{
			{
				Name:    "severity",
				Type:    "string",
				Value:   "W",
				Enabled: false,
			},
			{
				Name:    "severity",
				Type:    "string",
				Value:   "E",
				Enabled: false,
			},
			{
				Name:    "severity",
				Type:    "string",
				Value:   "C",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "DEV",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "CPU",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "DSK",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "MEM",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "NET",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "SRV",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "VRT",
				Enabled: false,
			},
		},
		Enabled: false,
	},
	{
		Name:        "Instance Level Notification",
		Description: `Configure how you are going to be notified for instance alerts, including levels "warning", and "critical".`,
		Match:       `"severity" == 'W' OR "severity" == 'C'`,
		Attributes: []Attribute{
			{
				Name:    "severity",
				Type:    "string",
				Value:   "W",
				Enabled: false,
			},
			{
				Name:    "severity",
				Type:    "string",
				Value:   "E",
				Enabled: false,
			},
			{
				Name:    "severity",
				Type:    "string",
				Value:   "C",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "DEV",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "CPU",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "DSK",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "MEM",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "NET",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "SRV",
				Enabled: false,
			},
			{
				Name:    "category",
				Type:    "string",
				Value:   "VRT",
				Enabled: false,
			},
		},
		Enabled: false,
	},
}

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Value   any    `json:"value"`
	Enabled bool   `json:"enabled"`
}

type Options

type Options struct {
	Name        string      `json:"name" yaml:"name"`
	Description string      `json:"description" yaml:"description"`
	Match       string      `json:"-" yaml:"match"`
	Attributes  []Attribute `json:"attributes" yaml:"attributes"`
	Response    `json:"response" yaml:"response"`
	Enabled     bool `json:"enabled" yaml:"enabled"`
}

func (*Options) HasEmailRecipients

func (o *Options) HasEmailRecipients() bool

func (*Options) HasSlackChannels

func (o *Options) HasSlackChannels() bool

func (*Options) InitResponse

func (o *Options) InitResponse()

type Response

type Response struct {
	Types  []string          `json:"types" yaml:"types"`
	Slacks []slack.Channel   `json:"slacks" yaml:"slacks"`
	Emails []email.Recipient `json:"emails" yaml:"emails"`
}

Jump to

Keyboard shortcuts

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