# Go-zabbix-api **Repository Path**: hoemfei/go-zabbix-api ## Basic Information - **Project Name**: Go-zabbix-api - **Description**: 用go封装了常用的zabbix-api - **Primary Language**: Go - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2022-06-03 - **Last Updated**: 2023-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Go-zabbix-api #### 介绍 用go封装了常用的zabbix-api ``` type zbxInterface interface { flushHostMap() //刷新加载hostMap getHostItem(groupID string) *ItemRst //获取主机组监控数据 getGroupID(groupName string) string //获取主机组id handleData(item *ItemRst, itemInfo *map[string]*hostItem) //处理获得组的json数据 getEvents(envts *map[string]int, EvntsClock *map[string][]string) getTemplate() map[string]string //获取模板id 返回值为: map["模板name"]="tempID" getHistory(itemid string) string /* 创建主机 传参列表-> 可见名称, hostname名称(agent配置文件里的那个), agentIP(主动模式填0.0.0.0即可), 主机组id, 端口号默认10050(主动模式填0) 链接哪些模板接收一个切片,接收一个 tempID切片, */ createHost(VisibleName, hostname, agentIP, groupID, port string, tempID []string) (string, error) deleteHost(hostArr []string) (err error) //删除主机,接收一个切片,批量删除主机 tgProblem() //检索在故障状态并且没确认的触发器 Close() error //关闭网络链接资源 } ```