pmm

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2016 License: AGPL-3.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PMMBaseDir = "/usr/local/percona/pmm-client"
)

Variables

View Source
var (
	ConfigFile = fmt.Sprintf("%s/pmm.yml", PMMBaseDir)
)
View Source
var VERSION = "1.0.3"

Functions

func DetectMySQL

func DetectMySQL(serviceType string, mf MySQLFlags) (map[string]string, error)

DetectMySQL detect MySQL, create user if needed, return DSN and MySQL info strings.

func FileExists

func FileExists(file string) bool

FileExists check if file exists.

func SanitizeDSN

func SanitizeDSN(dsn string) string

SanitizeDSN remove password from DSN

Types

type API

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

func NewAPI

func NewAPI(headers map[string]string) *API

func (*API) Delete

func (a *API) Delete(url string) (*http.Response, []byte, error)

func (*API) Error

func (a *API) Error(method, url string, gotStatusCode, expectedStatusCode int, content []byte) error

func (*API) Get

func (a *API) Get(url string) (*http.Response, []byte, error)

func (*API) Hostname

func (a *API) Hostname() string

func (*API) Ping

func (a *API) Ping(url string) error

func (*API) Post

func (a *API) Post(url string, data []byte) (*http.Response, []byte, error)

func (*API) Put

func (a *API) Put(url string, data []byte) (*http.Response, []byte, error)

func (*API) URL

func (a *API) URL(addr string, paths ...string) string

type Admin

type Admin struct {
	ServiceName string
	ServicePort uint
	Config      *Config
	// contains filtered or unexported fields
}

Main class.

func (*Admin) AddMongoDB

func (a *Admin) AddMongoDB(uri, nodetype, replset, cluster string) error

AddMongoDB add mongodb service to monitoring.

func (*Admin) AddMySQL

func (a *Admin) AddMySQL(info map[string]string, mf MySQLFlags) error

AddMySQL add mysql services to monitoring.

func (*Admin) AddOS

func (a *Admin) AddOS() error

AddOS add OS service to monitoring.

func (*Admin) AddQueries

func (a *Admin) AddQueries(info map[string]string) error

AddQueries add mysql instance to QAN.

func (*Admin) CheckNetwork

func (a *Admin) CheckNetwork(noEmoji bool) error

CheckNetwork check connectivity between client and server.

func (*Admin) List

func (a *Admin) List() error

List get all services from Consul.

func (*Admin) LoadConfig

func (a *Admin) LoadConfig(filename string) error

LoadConfig read PMM client config file.

func (*Admin) PrintInfo

func (a *Admin) PrintInfo()

GetInfo print PMM client info.

func (*Admin) RemoveMongoDB

func (a *Admin) RemoveMongoDB(name string) error

RemoveMongoDB remove mongodb service from monitoring.

func (*Admin) RemoveMySQL

func (a *Admin) RemoveMySQL(name string) error

RemoveMySQL remove mysql services from monitoring.

func (*Admin) RemoveOS

func (a *Admin) RemoveOS(name string) error

RemoveOS remove os service from monitoring.

func (*Admin) RemoveQueries

func (a *Admin) RemoveQueries(name string) error

RemoveQueries remove mysql instance from QAN.

func (*Admin) ServerAlive

func (a *Admin) ServerAlive() bool

ServerAlive check if PMM server is alive.

func (*Admin) SetAPI

func (a *Admin) SetAPI()

SetAPI setup Consul and QAN APIs.

func (*Admin) SetConfig

func (a *Admin) SetConfig(serverAddress, clientAddress, clientName string) error

SetConfig configure PMM client with server and client addresses, write them to the config.

func (*Admin) StartStopAllMonitoring

func (a *Admin) StartStopAllMonitoring(action string) (error, bool)

StartStopAllMonitoring start/stop all metric services.

func (*Admin) StartStopMonitoring

func (a *Admin) StartStopMonitoring(action, metric, name string) error

StartStopMonitoring start/stop system service by its metric type and name.

type Config

type Config struct {
	ServerAddress string `yaml:"server_address"`
	ClientAddress string `yaml:"client_address"`
	ClientName    string `yaml:"client_name"`
}

PMM client config structure.

type MySQLFlags

type MySQLFlags struct {
	DefaultsFile       string
	User               string
	Password           string
	Host               string
	Port               string
	Socket             string
	QuerySource        string
	MaxUserConn        uint
	OldPasswords       bool
	CreateUser         bool
	DisableTableStats  bool
	DisableUserStats   bool
	DisableBinlogStats bool
	DisableProcesslist bool
}

MySQL and agent specific options.

Jump to

Keyboard shortcuts

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