sqlserver

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 13 Imported by: 0

README

kubernetes

forked from telegraf/sqlserver. 这个插件的作用是获取sqlserver的监控指标,这里去掉了Azure相关部分监控,只保留了本地部署sqlserver情况。

按照下面方法创建监控账号,用于读取监控数据

USE master;

CREATE LOGIN [categraf] WITH PASSWORD = N'mystrongpassword';

GRANT VIEW SERVER STATE TO [categraf];

GRANT VIEW ANY DEFINITION TO [categraf]; Data Source=10.19.1.1;Initial Catalog=hc;User ID=sa;Password=mystrongpassword;

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthMetric

type HealthMetric struct {
	AttemptedQueries  int
	SuccessfulQueries int
}

HealthMetric struct tracking the number of attempted vs successful connections for each connection string

type Instance

type Instance struct {
	config.InstanceConfig
	Servers      []string `toml:"servers"`
	AuthMethod   string   `toml:"auth_method"`
	QueryVersion int      `toml:"query_version" deprecated:"1.16.0;use 'database_type' instead"`
	DatabaseType string   `toml:"database_type"`
	IncludeQuery []string `toml:"include_query"`
	ExcludeQuery []string `toml:"exclude_query"`
	HealthMetric bool     `toml:"health_metric"`
	// contains filtered or unexported fields
}

SQLServer struct

func (*Instance) Drop

func (s *Instance) Drop()

Stop cleanup server connection pools

func (*Instance) Gather

func (s *Instance) Gather(slist *types.SampleList)

Gather collect data from SQL Server

func (*Instance) Init

func (s *Instance) Init() error

Start initialize a list of connection pools

type MapQuery

type MapQuery map[string]Query

MapQuery type

type Query

type Query struct {
	ScriptName     string
	Script         string
	ResultByRow    bool
	OrderedColumns []string
}

Query struct

type SQLServer

type SQLServer struct {
	config.PluginConfig
	Instances []*Instance `toml:"instances"`
}

func (*SQLServer) Clone

func (pt *SQLServer) Clone() inputs.Input

func (*SQLServer) GetInstances

func (pt *SQLServer) GetInstances() []inputs.Instance

func (*SQLServer) Name

func (pt *SQLServer) Name() string

Jump to

Keyboard shortcuts

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