Documentation ¶
Index ¶
- Constants
- Variables
- func MustFloat64(p QueryFunctionParam) (float64, error)
- func MustString(p QueryFunctionParam) (string, error)
- type AggDataProcessingFunc
- type DBConnectionPostProcessingRequest
- type DataProcessingFunc
- type PreProcessingFunc
- type QueryFilter
- type QueryFunction
- type QueryFunctionDef
- type QueryFunctionParam
- type QueryFunctionParamDef
- type QueryModel
- type QueryOptions
- type ScopedVar
- type TimeRangePostProcessingRequest
- type ZabbixAPIResourceRequest
- type ZabbixAPIResourceResponse
- type ZabbixDatasource
- func (ds *ZabbixDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (ds *ZabbixDatasource) DBConnectionPostProcessingHandler(rw http.ResponseWriter, req *http.Request)
- func (ds *ZabbixDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- func (ds *ZabbixDatasource) RootHandler(rw http.ResponseWriter, req *http.Request)
- func (ds *ZabbixDatasource) ZabbixAPIHandler(rw http.ResponseWriter, req *http.Request)
- type ZabbixDatasourceInstance
Constants ¶
View Source
const ( MODE_METRICS = "0" MODE_ITSERVICE = "1" MODE_TEXT = "2" MODE_ITEMID = "3" MODE_TRIGGERS = "4" MODE_PROBLEMS = "5" )
View Source
const RANGE_VARIABLE_VALUE = "range_series"
Variables ¶
View Source
var ( ErrFunctionsNotSupported = errors.New("zabbix queries with functions are not supported") ErrNonMetricQueryNotSupported = errors.New("non-metrics queries are not supported") )
Functions ¶
func MustFloat64 ¶
func MustFloat64(p QueryFunctionParam) (float64, error)
func MustString ¶
func MustString(p QueryFunctionParam) (string, error)
Types ¶
type AggDataProcessingFunc ¶
type AggDataProcessingFunc = func(series []*timeseries.TimeSeriesData, params ...interface{}) ([]*timeseries.TimeSeriesData, error)
type DBConnectionPostProcessingRequest ¶
type DBConnectionPostProcessingRequest struct { Query QueryModel `json:"query"` TimeRange TimeRangePostProcessingRequest `json:"timeRange"` Series []*timeseries.TimeSeriesData `json:"series"` }
type DataProcessingFunc ¶
type DataProcessingFunc = func(series timeseries.TimeSeries, params ...interface{}) (timeseries.TimeSeries, error)
type PreProcessingFunc ¶
type PreProcessingFunc = func(query *QueryModel, items []*zabbix.Item, params ...interface{}) error
type QueryFunction ¶
type QueryFunction struct { Def QueryFunctionDef `json:"def"` Params []QueryFunctionParam `json:"params"` Text string `json:"text"` }
QueryOptions model
type QueryFunctionDef ¶
type QueryFunctionDef struct { Name string `json:"name"` Category string `json:"category"` Params []QueryFunctionParamDef `json:"params"` DefaultParams []QueryFunctionParam `json:"defaultParams"` }
QueryOptions model
type QueryFunctionParam ¶
type QueryFunctionParam = interface{}
type QueryFunctionParamDef ¶
type QueryModel ¶
type QueryModel struct { // Deprecated `mode` field, use QueryType instead Mode int64 `json:"mode"` QueryType string `json:"-"` Group QueryFilter `json:"group"` Host QueryFilter `json:"host"` Application QueryFilter `json:"application"` ItemTag QueryFilter `json:"itemTag"` Item QueryFilter `json:"item"` // Item ID mode ItemIDs string `json:"itemids,omitempty"` Functions []QueryFunction `json:"functions,omitempty"` Options QueryOptions `json:"options"` // Direct from the gRPC interfaces RefID string `json:"-"` TimeRange backend.TimeRange `json:"-"` MaxDataPoints int64 `json:"-"` Interval time.Duration `json:"-"` }
QueryModel model
type QueryOptions ¶
type QueryOptions struct { ShowDisabledItems bool `json:"showDisabledItems"` DisableDataAlignment bool `json:"disableDataAlignment"` UseZabbixValueMapping bool `json:"useZabbixValueMapping"` UseTrends string `json:"useTrends"` }
QueryOptions model
type ZabbixAPIResourceResponse ¶
type ZabbixAPIResourceResponse struct {
Result interface{} `json:"result,omitempty"`
}
func BuildAPIResponse ¶
func BuildAPIResponse(responseData *interface{}) (*ZabbixAPIResourceResponse, error)
type ZabbixDatasource ¶
type ZabbixDatasource struct {
// contains filtered or unexported fields
}
func NewZabbixDatasource ¶
func NewZabbixDatasource() *ZabbixDatasource
func (*ZabbixDatasource) CheckHealth ¶
func (ds *ZabbixDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
CheckHealth checks if the plugin is running properly
func (*ZabbixDatasource) DBConnectionPostProcessingHandler ¶
func (ds *ZabbixDatasource) DBConnectionPostProcessingHandler(rw http.ResponseWriter, req *http.Request)
func (*ZabbixDatasource) QueryData ¶
func (ds *ZabbixDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
func (*ZabbixDatasource) RootHandler ¶
func (ds *ZabbixDatasource) RootHandler(rw http.ResponseWriter, req *http.Request)
func (*ZabbixDatasource) ZabbixAPIHandler ¶
func (ds *ZabbixDatasource) ZabbixAPIHandler(rw http.ResponseWriter, req *http.Request)
type ZabbixDatasourceInstance ¶
type ZabbixDatasourceInstance struct { Settings *settings.ZabbixDatasourceSettings // contains filtered or unexported fields }
ZabbixDatasourceInstance stores state about a specific datasource and provides methods to make requests to the Zabbix API
func (*ZabbixDatasourceInstance) TestConnection ¶
func (ds *ZabbixDatasourceInstance) TestConnection(ctx context.Context) (string, error)
TestConnection checks authentication and version of the Zabbix API and returns that info
func (*ZabbixDatasourceInstance) ZabbixAPIQuery ¶
func (ds *ZabbixDatasourceInstance) ZabbixAPIQuery(ctx context.Context, apiReq *zabbix.ZabbixAPIRequest) (*ZabbixAPIResourceResponse, error)
ZabbixAPIQuery handles query requests to Zabbix API
Click to show internal directories.
Click to hide internal directories.