cmd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Install cli
	Install = cli.Command{
		Name:        "install",
		Usage:       "Install ms-agent tools to Zabbix Server",
		Description: "Install ms-agent tools to Zabbix Server",
		Action:      installAagent,
	}

	API = &zabbix.API{}
)
View Source
var (
	// Init cli
	Init = cli.Command{
		Name:        "init",
		Usage:       "Init config file",
		Description: "A tools to send alarm message to ZbxTable",
		Action:      AppInit,
	}
)
View Source
var (
	// Install cli
	Ua = cli.Command{
		Name:        "ua",
		Usage:       "Update action",
		Description: "Update action",
		Action:      UpdateAction,
	}
)
View Source
var (
	//Web 配置
	Uc = cli.Command{
		Name:        "uc",
		Usage:       "Update config file",
		Description: "Update config file",
		Action:      updateconfig,
	}
)
View Source
var (
	//Web 配置
	Web = cli.Command{
		Name:        "web",
		Usage:       "Start web server",
		Description: "ZbxTable web server",
		Action:      runWeb,
	}
)

Functions

func AppInit added in v1.1.0

func AppInit(c *cli.Context)

AppInit

func CheckConf added in v1.1.0

func CheckConf(zabbix_web, zabbix_user, zabbix_pass,
	dbtype, dbhost, dbuser, dbpass, dbname, dbport string) error

check conf

func CheckDb added in v1.1.0

func CheckDb(dbdriver, dbhost, dbuser, dbpass, dbname string, dbport string) error

CheckDb

func CheckZabbix added in v1.1.0

func CheckZabbix(address, user, pass string) (string, error)

CheckZabbix

func CreateEventTpl added in v1.1.0

func CreateEventTpl() string

func GetActionID added in v1.1.0

func GetActionID(value interface{}) (string, error)

func GetMediaTypeID added in v1.1.0

func GetMediaTypeID(value interface{}) (string, error)

func LoginZabbix added in v1.1.0

func LoginZabbix() (string, error)

func PreCheckConf added in v1.1.0

func PreCheckConf() error

check conf

func RandStringRunes

func RandStringRunes() string

RandStringRunes 随机密码生成

func UpdateAction added in v1.1.0

func UpdateAction(c *cli.Context)

func WriteConf added in v1.1.0

func WriteConf(zabbix_web, zabbix_user, zabbix_pass,
	dbtype, dbhost, dbuser, dbpass, dbname, dbport,
	httpport, runmode, timeout, token string) error

Write config files

Types

type ActionResult added in v1.1.0

type ActionResult struct {
	ActionID string `json:"actionid"`
}

type EventTpl added in v1.1.0

type EventTpl struct {
	HostsID      string `json:"host_id"`
	HostHost     string `json:"host_host"`
	Hostname     string `json:"hostname"`
	HostsIP      string `json:"host_ip"`
	HostGroup    string `json:"host_group"`
	EventTime    string `json:"event_time"`
	Severity     string `json:"severity"`
	TriggerID    string `json:"trigger_id"`
	TriggerName  string `json:"trigger_name"`
	TriggerKey   string `json:"trigger_key"`
	TriggerValue string `json:"trigger_value"`
	ItemID       string `json:"item_id"`
	ItemName     string `json:"item_name"`
	ItemValue    string `json:"item_value"`
	EventID      string `json:"event_id"`
}

type MediaResult added in v1.1.0

type MediaResult struct {
	MediaTypeID string `json:"mediatypeid"`
}

Jump to

Keyboard shortcuts

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