Documentation
¶
Index ¶
- Variables
- func AppInit(*cli.Context) error
- func CheckConfExist()
- func CheckDb(dbdriver, dbhost, dbuser, dbpass, dbname string, dbport string) error
- func CheckZabbixAPI(address, user, pass string) (string, error)
- func CreateEventTpl() string
- func GetActionID(ActionName string) (string, error)
- func GetMediaTypeID(MediaName string) (string, error)
- func InitConfig(v string) string
- func PreCheckConf(...) error
- func RandStringRunes() string
- func UninstallAction(*cli.Context) error
- func UpdateAction(*cli.Context) error
- func WriteConf(...) error
- type EventTpl
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Init cli Init = &cli.Command{ Name: "init", Usage: "Init config file", Action: AppInit, } API = &zabbix.API{} Cfg = &ini.File{} )
View Source
var ( MSName = "ms-agent" MSUser = "ms-agent" MSGroup = "MS-Agent Group" MSMedia = "MS-Agent Media" MSAction = "MS-Agent Action" )
ms-aget const
View Source
var (
// Install cli
Install = &cli.Command{
Name: "install",
Usage: "Install ms-agent tools to Zabbix Server",
Action: installAagent,
}
)
View Source
var ( // Install cli Ua = &cli.Command{ Name: "ua", Usage: "Update action", Action: UpdateAction, } )
View Source
var (
//config update
Uc = &cli.Command{
Name: "uc",
Usage: "Update config file",
Action: updateconfig,
}
)
View Source
var ( // Install cli Un = &cli.Command{ Name: "un", Usage: "Uninstall action", Action: UninstallAction, } )
View Source
var (
//Web 配置
Web = &cli.Command{
Name: "web",
Usage: "Start web server",
Action: runWeb,
}
)
Functions ¶
func CheckZabbixAPI ¶ added in v1.1.2
LoginZabbixAPI Check
func CreateEventTpl ¶ added in v1.1.0
func CreateEventTpl() string
func GetActionID ¶ added in v1.1.0
GetActionID by actionname
func GetMediaTypeID ¶ added in v1.1.0
GetMediaTypeID by medianame
func PreCheckConf ¶ added in v1.1.0
func PreCheckConf(zabbix_web, zabbix_user, zabbix_pass, dbtype, dbhost, dbuser, dbpass, dbname, dbport string) error
check conf
func UninstallAction ¶ added in v1.1.2
func UninstallAction(*cli.Context) error
func UpdateAction ¶ added in v1.1.0
func UpdateAction(*cli.Context) error
Types ¶
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"` }
Click to show internal directories.
Click to hide internal directories.