Documentation ¶
Overview ¶
Package zabbix-jmx provides methods for working with Zabbix Java Gateway
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bean ¶
type Bean struct { Domain string `json:"{#JMXDOMAIN}"` Type string `json:"{#JMXTYPE}"` Object string `json:"{#JMXOBJ}"` Name string `json:"{#JMXNAME}"` }
Bean contains basic bean info
type Client ¶
type Client struct { ConnectTimeout time.Duration WriteTimeout time.Duration ReadTimeout time.Duration // contains filtered or unexported fields }
Client is Zabbix JMX client
func NewClient ¶
NewClient creates new client
Example ¶
client, err := NewClient("127.0.0.1:9335") if err != nil { fmt.Printf("Error: %v\n", err) return } client.WriteTimeout = time.Second * 3 client.ReadTimeout = time.Second * 3
Output:
func (*Client) Get ¶
Get fetches data from Java Gateway
Example ¶
client, err := NewClient("127.0.0.1:9335") if err != nil { fmt.Printf("Error: %v\n", err) return } r := &Request{ Server: "domain.com", Port: 9093, Username: "admin", Password: "admin", Keys: []string{`jmx["kafka.server:type=ReplicaManager,name=PartitionCount",Value]`}, } resp, err := client.Get(r) if err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("Resp value: %s\n", resp[0].Value)
Output:
type ResponseData ¶
type ResponseData struct {
Value string `json:"value"`
}
ResponseData contains value for requested key
Click to show internal directories.
Click to hide internal directories.