pigeon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenAlarmMesage

func GenAlarmMesage(alarminfo Alarm) string

func GenAlarmSubject

func GenAlarmSubject(alarminfo Alarm) string

func GenFalconView

func GenFalconView(alarminfo Alarm) string

func GenSmsSubject

func GenSmsSubject(alarminfo Alarm) string

func LogPigeonAlarm

func LogPigeonAlarm(alarminfo Alarms, pigeonID string)

func SendPigeonAlarm

func SendPigeonAlarm(p Alarm) (err error)

Types

type Alarm

type Alarm struct {
	Domain   string `json:"domain"`
	Hostname string `json:"hostname"`
	Event    string `json:"event"`
	Detail   string `json:"detail"`
	Ip       string `json:"ip"`
	Value    string `json:"value"`
	Metric   string `json:"metric"`
	Priority string `json:"priority"`
	Status   int    `json:"status"`
	Message  string `json:"message"`
	Transfer string `json:"transfer"`
}

type Alarms

type Alarms struct {
	Fid       string    `json:"fid"`
	AlarmCode string    `json:"alarm_code"` // none
	Value     string    `json:"value"`
	Subject   string    `json:"subject"`
	Sms       string    `json:"sms"` // none
	Message   string    `json:"message"`
	Priority  string    `json:"priority"`
	Host      string    `json:"host"`
	HostName  string    `json:"hostname"` // none
	Domain    string    `json:"domain"`
	Transfer  string    `json:"transfer"`
	AlarmTime string    `json:"alarm_time"`
	ExtArgs   []*ExtArg `json:"ext_args"`
}

func GenPigeonAlarmData

func GenPigeonAlarmData(alarminfo Alarm) Alarms

type ExtArg

type ExtArg struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type GenReport

type GenReport struct {
	Data struct {
		Pigeon struct {
			Alarm []Alarms `json:"alarms"`
			App   struct {
				Source string `json:"source"`
				Key    string `json:"key"`
			} `json:"app"`
		} `json:"pigeon"`
	} `json:"data"`
}

type M3Body

type M3Body struct {
	Metric       string `json:"metric"`
	DatasourceID int    `json:"datasourceId"`
	From         int64  `json:"from"`
	Step         int    `json:"step"`
	Source       string `json:"source"`
	To           int64  `json:"to"`
	Type         string `json:"type"`
}

type M3Chart

type M3Chart struct {
	Legend string `json:"legend"`
	Title  string `json:"title"`
}

type M3Value

type M3Value struct {
	Body  string  `json:"body"`
	Chart M3Chart `json:"chart"`
	URL   string  `json:"url"`
}

type PigeonResopose

type PigeonResopose struct {
	Success bool   `json:"success"`
	Code    int    `json:"code"`
	Object  string `json:"object"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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