Documentation ¶
Index ¶
Constants ¶
View Source
const (
ICINGA_LINK = "%s/monitoring/service/show?host=%s&service=%s"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailConfig ¶
type EmailConfig struct { Default string `yaml:"default"` Tenants map[string]*SMTPConfig `yaml:"tenants"` }
type EmailNotifier ¶
type EmailNotifier struct {
// contains filtered or unexported fields
}
func NewEmailNotifier ¶
func NewEmailNotifier(tenant string) (*EmailNotifier, error)
func (*EmailNotifier) SendHostAlert ¶
func (n *EmailNotifier) SendHostAlert(alert *HostAlertConfig, targets ...string) error
func (*EmailNotifier) SendMessage ¶
func (n *EmailNotifier) SendMessage(message *MessageConfig, targets ...string) error
func (*EmailNotifier) SendServiceAlert ¶
func (n *EmailNotifier) SendServiceAlert(alert *ServiceAlertConfig, targets ...string) error
type HostAlertConfig ¶
type HostAlertConfig struct { HostAddress string `env:"HOSTADDRESS"` HostDisplayName string `env:"HOSTDISPLAYNAME"` HostName string `env:"HOSTNAME"` HostOutput string `env:"HOSTOUTPUT"` HostState string `env:"HOSTSTATE"` HostDurationSec string `env:"HOSTDURATIONSEC"` LongDateTime string `env:"LONGDATETIME"` NotificationAuthorName string `env:"NOTIFICATIONAUTHORNAME"` NotificationComment string `env:"NOTIFICATIONCOMMENT"` NotificationType string `env:"NOTIFICATIONTYPE"` ContactName string `env:"CONTACTNAME"` // custom AckLinkURL string `env:"ACKLINKURL"` // contains filtered or unexported fields }
func HostAlertFromEnv ¶
func HostAlertFromEnv() (*HostAlertConfig, error)
func (*HostAlertConfig) Duration ¶
func (c *HostAlertConfig) Duration() string
func (*HostAlertConfig) Subject ¶
func (c *HostAlertConfig) Subject() string
type LarkConfig ¶
type LarkNotifier ¶
type LarkNotifier struct {
// contains filtered or unexported fields
}
func NewLarkNotifier ¶
func NewLarkNotifier(tenant string) (*LarkNotifier, error)
func (*LarkNotifier) SendHostAlert ¶
func (n *LarkNotifier) SendHostAlert(alert *HostAlertConfig, targets ...string) error
func (*LarkNotifier) SendMessage ¶
func (n *LarkNotifier) SendMessage(message *MessageConfig, targets ...string) error
func (*LarkNotifier) SendServiceAlert ¶
func (n *LarkNotifier) SendServiceAlert(alert *ServiceAlertConfig, targets ...string) error
type LarkTenantConfig ¶
type LarkTenantConfig struct { Default string `yaml:"default"` Tenants map[string]*LarkConfig `yaml:"tenants"` }
type MessageConfig ¶
type Notifier ¶
type Notifier interface { SendMessage(message *MessageConfig, targets ...string) error SendHostAlert(alert *HostAlertConfig, targets ...string) error SendServiceAlert(alert *ServiceAlertConfig, targets ...string) error }
func GetNotifier ¶
type SMTPConfig ¶
type ServiceAlertConfig ¶
type ServiceAlertConfig struct { HostAddress string `env:"HOSTADDRESS"` HostDisplayName string `env:"HOSTDISPLAYNAME"` HostName string `env:"HOSTNAME"` LongDateTime string `env:"LONGDATETIME"` NotificationAuthorName string `env:"NOTIFICATIONAUTHORNAME"` NotificationComment string `env:"NOTIFICATIONCOMMENT"` NotificationType string `env:"NOTIFICATIONTYPE"` ServiceDisplayName string `env:"SERVICEDISPLAYNAME"` ServiceName string `env:"SERVICENAME"` ServiceOutput string `env:"SERVICEOUTPUT"` ServiceState string `env:"SERVICESTATE"` ServiceDurationSec string `env:"SERVICEDURATIONSEC"` ContactName string `env:"CONTACTNAME"` // custom IcingaWebBaseURL string `env:"ICINGAWEBBASEURL"` ServiceWiki string `env:"SERVICEWIKI"` AckLinkURL string `env:"ACKLINKURL"` // contains filtered or unexported fields }
func ServiceAlertFromEnv ¶
func ServiceAlertFromEnv() (*ServiceAlertConfig, error)
func (*ServiceAlertConfig) Duration ¶
func (c *ServiceAlertConfig) Duration() string
func (*ServiceAlertConfig) Subject ¶
func (c *ServiceAlertConfig) Subject() string
Click to show internal directories.
Click to hide internal directories.