checks

package
v2.17.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package checks provides security checks functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAdditionalContext

func GetAdditionalContext() map[string]starlark.GoFunc

GetAdditionalContext returns additional functions to be used in check scripts.

func GetFuncsForVersion

func GetFuncsForVersion(version uint32) (map[string]starlark.GoFunc, error)

GetFuncsForVersion returns predefined functions for specified check version.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is responsible for interactions with Percona Check service.

func New

func New(agentsRegistry agentsRegistry, alertmanagerService alertmanagerService, db *reform.DB) (*Service, error)

New returns Service with given PMM version.

func (*Service) ChangeInterval

func (s *Service) ChangeInterval(params map[string]check.Interval) error

ChangeInterval changes a check's interval to the value received from the UI.

func (*Service) CleanupAlerts

func (s *Service) CleanupAlerts()

CleanupAlerts drops all alerts in registry.

func (*Service) Collect

func (s *Service) Collect(ch chan<- prom.Metric)

Collect implements prom.Collector.

func (*Service) Describe

func (s *Service) Describe(ch chan<- *prom.Desc)

Describe implements prom.Collector.

func (*Service) DisableChecks

func (s *Service) DisableChecks(checkNames []string) error

DisableChecks disables checks with provided names.

func (*Service) EnableChecks

func (s *Service) EnableChecks(checkNames []string) error

EnableChecks enables checks with provided names.

func (*Service) GetAllChecks

func (s *Service) GetAllChecks() map[string]check.Check

GetAllChecks returns all available checks.

func (*Service) GetDisabledChecks

func (s *Service) GetDisabledChecks() ([]string, error)

GetDisabledChecks returns disabled checks.

func (*Service) GetSecurityCheckResults

func (s *Service) GetSecurityCheckResults() ([]check.Result, error)

GetSecurityCheckResults returns the results of the STT checks that were run. It returns services.ErrSTTDisabled if STT is disabled.

func (*Service) Run

func (s *Service) Run(ctx context.Context)

Run runs main service loops.

func (*Service) StartChecks

func (s *Service) StartChecks(ctx context.Context, intervalGroup check.Interval, checkNames []string) error

StartChecks triggers STT checks downloading and execution. If intervalGroup specified only checks from that group will be executed. If checkNames specified then only matched checks will be executed.

func (*Service) UpdateIntervals

func (s *Service) UpdateIntervals(rare, standard, frequent time.Duration)

UpdateIntervals updates STT restart timers intervals.

type StarlarkScriptData

type StarlarkScriptData struct {
	Version     uint32 `json:"version"`
	Name        string `json:"name"`
	Script      string `json:"script"`
	QueryResult []byte `json:"query_result"`
}

StarlarkScriptData represents the data we need to pass to the binary to run starlark scripts.

Jump to

Keyboard shortcuts

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