Documentation ¶
Index ¶
- func HashString(text string) string
- func IsCachedRequest(method string) bool
- type Application
- type Group
- type History
- type HistoryPoint
- type Host
- type Item
- type ItemHost
- type ItemTag
- type Items
- type Trend
- type TrendPoint
- type ValueMap
- type ValueMapping
- type Zabbix
- func (zabbix *Zabbix) Authenticate(ctx context.Context) error
- func (zabbix *Zabbix) GetAPI() *zabbixapi.ZabbixAPI
- func (ds *Zabbix) GetAllApps(ctx context.Context, hostids []string) ([]Application, error)
- func (ds *Zabbix) GetAllGroups(ctx context.Context) ([]Group, error)
- func (ds *Zabbix) GetAllHosts(ctx context.Context, groupids []string) ([]Host, error)
- func (ds *Zabbix) GetAllItems(ctx context.Context, hostids []string, appids []string, itemtype string, ...) ([]*Item, error)
- func (ds *Zabbix) GetApps(ctx context.Context, groupFilter string, hostFilter string, appFilter string) ([]Application, error)
- func (ds *Zabbix) GetGroups(ctx context.Context, groupFilter string) ([]Group, error)
- func (ds *Zabbix) GetHistory(ctx context.Context, items []*Item, timeRange backend.TimeRange) (History, error)
- func (ds *Zabbix) GetHosts(ctx context.Context, groupFilter string, hostFilter string) ([]Host, error)
- func (ds *Zabbix) GetItemTags(ctx context.Context, groupFilter string, hostFilter string, tagFilter string) ([]ItemTag, error)
- func (ds *Zabbix) GetItems(ctx context.Context, groupFilter string, hostFilter string, ...) ([]*Item, error)
- func (ds *Zabbix) GetItemsBefore54(ctx context.Context, groupFilter string, hostFilter string, appFilter string, ...) ([]*Item, error)
- func (ds *Zabbix) GetItemsByIDs(ctx context.Context, itemids []string) ([]*Item, error)
- func (ds *Zabbix) GetTrend(ctx context.Context, items []*Item, timeRange backend.TimeRange) (Trend, error)
- func (ds *Zabbix) GetValueMappings(ctx context.Context) ([]ValueMap, error)
- func (ds *Zabbix) GetVersion(ctx context.Context) (int, error)
- func (ds *Zabbix) Request(ctx context.Context, apiReq *ZabbixAPIRequest) (*simplejson.Json, error)
- type ZabbixAPIParams
- type ZabbixAPIRequest
- type ZabbixCache
- type ZabbixDatasourceSettings
- type ZabbixDatasourceSettingsDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashString ¶
HashString converts the given text string to hash string
func IsCachedRequest ¶
Types ¶
type Application ¶
type History ¶
type History []HistoryPoint
type HistoryPoint ¶
type Item ¶
type Item struct { ID string `json:"itemid,omitempty"` Key string `json:"key_,omitempty"` Name string `json:"name,omitempty"` ValueType int `json:"value_type,omitempty,string"` HostID string `json:"hostid,omitempty"` Hosts []ItemHost `json:"hosts,omitempty"` Status string `json:"status,omitempty"` State string `json:"state,omitempty"` Delay string `json:"delay,omitempty"` Units string `json:"units,omitempty"` ValueMapID string `json:"valuemapid,omitempty"` Tags []ItemTag `json:"tags,omitempty"` }
func (*Item) ExpandItemName ¶
type Trend ¶
type Trend []TrendPoint
type TrendPoint ¶
type ValueMap ¶
type ValueMap struct { ID string `json:"valuemapid"` Name string `json:"name"` Mappings []ValueMapping `json:"mappings"` }
type ValueMapping ¶
type Zabbix ¶
type Zabbix struct {
// contains filtered or unexported fields
}
Zabbix is a wrapper for Zabbix API. It wraps Zabbix API queries and performs authentication, adds caching, deduplication and other performance optimizations.
func MockZabbixClient ¶
func New ¶
func New(dsInfo *backend.DataSourceInstanceSettings, zabbixSettings *settings.ZabbixDatasourceSettings, zabbixAPI *zabbixapi.ZabbixAPI) (*Zabbix, error)
New returns new instance of Zabbix client.
func (*Zabbix) GetAllApps ¶
func (*Zabbix) GetAllHosts ¶
func (*Zabbix) GetAllItems ¶
func (*Zabbix) GetHistory ¶
func (*Zabbix) GetItemTags ¶
func (*Zabbix) GetItemsBefore54 ¶
func (*Zabbix) GetItemsByIDs ¶
func (*Zabbix) GetValueMappings ¶
type ZabbixAPIParams ¶
type ZabbixAPIParams = map[string]interface{}
type ZabbixAPIRequest ¶
type ZabbixAPIRequest struct { Method string `json:"method"` Params ZabbixAPIParams `json:"params,omitempty"` }
func (*ZabbixAPIRequest) String ¶
func (r *ZabbixAPIRequest) String() string
type ZabbixCache ¶
type ZabbixCache struct {
// contains filtered or unexported fields
}
ZabbixCache is a cache for datasource instance.
func NewZabbixCache ¶
func NewZabbixCache(ttl time.Duration, cleanupInterval time.Duration) *ZabbixCache
NewZabbixCache creates a DatasourceCache with expiration(ttl) time and cleanupInterval.
func (*ZabbixCache) GetAPIRequest ¶
func (c *ZabbixCache) GetAPIRequest(request *ZabbixAPIRequest) (interface{}, bool)
GetAPIRequest gets request response from cache
func (*ZabbixCache) SetAPIRequest ¶
func (c *ZabbixCache) SetAPIRequest(request *ZabbixAPIRequest, response interface{})
SetAPIRequest writes request response to cache
Click to show internal directories.
Click to hide internal directories.