zbx

package
v0.0.0-...-68d9b67 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WILDCARD = "*Микро*" //"*Березо*"

Functions

func Run

func Run(username string, password string, comandToMM chan<- msgmngr.CommandFromZbx, svdZbxHosts *brds.SavedHosts)

Run launches the Zabbix API client.

Types

type ZabbixClient

type ZabbixClient struct {
	Username string
	Password string
	Result   string
	Id       int
	URL      string
}

ZabbixClient represents an instance of the Zabbix API client.

func (*ZabbixClient) Authentication

func (c *ZabbixClient) Authentication() error

Authentication authenticates the Zabbix API client.

func (*ZabbixClient) GetHost

func (c *ZabbixClient) GetHost(pattern string) ([]map[string]string, error)

GetHost retrieves hosts according to the specified hostname pattern.

func (*ZabbixClient) GetTrigger

func (c *ZabbixClient) GetTrigger(hosts []map[string]string, svdZbxHosts *brds.SavedHosts) error
GetTrigger retrieves triggered triggers for the specified hosts.

It then sends information about the hosts over the specified channel (outZabbix).

type ZabbixParams

type ZabbixParams struct {
	Output                 []string          `json:"output,omitempty"`
	Search                 map[string]string `json:"search,omitempty"`
	SearchWildcardsEnabled bool              `json:"searchWildcardsEnabled,omitempty"`
	SearchByAny            bool              `json:"searchByAny,omitempty"`
	Username               string            `json:"username,omitempty"`
	Password               string            `json:"password,omitempty"`
	Host                   string            `json:"host,omitempty"`
	Monitored_hosts        int               `json:"monitored_hosts,omitempty"`
}

For information about the Zabbix API, see the link https://www.zabbix.com/documentation/current/en/manual/api.

type ZabbixRequest

type ZabbixRequest struct {
	Jsonrpc string       `json:"jsonrpc,omitempty"`
	Method  string       `json:"method,omitempty"`
	Params  ZabbixParams `json:"params,omitempty"`
	Auth    string       `json:"auth,omitempty"`
	Id      int          `json:"id,omitempty"`
	Result  string       `json:"result,omitempty"`
}

type ZabbixResponse

type ZabbixResponse struct {
	Jsonrpc string              `json:"jsonrpc,omitempty"`
	Result  []map[string]string `json:"result,omitempty"`
	// Hosts   []map[string]string `json:"host,omitempty"`
	Id int `json:"id,omitempty"`
}
type ZabbixParamsResponseHos {
	Output   []string `json:"output,omitempty"`
}

Jump to

Keyboard shortcuts

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