Documentation ¶
Index ¶
- Constants
- Variables
- func DetectMySQL(serviceType string, mf MySQLFlags) (map[string]string, error)
- func FileExists(file string) bool
- func SanitizeDSN(dsn string) string
- type API
- func (a *API) Delete(url string) (*http.Response, []byte, error)
- func (a *API) Error(method, url string, gotStatusCode, expectedStatusCode int, content []byte) error
- func (a *API) Get(url string) (*http.Response, []byte, error)
- func (a *API) Hostname() string
- func (a *API) Ping(url string) error
- func (a *API) Post(url string, data []byte) (*http.Response, []byte, error)
- func (a *API) Put(url string, data []byte) (*http.Response, []byte, error)
- func (a *API) URL(addr string, paths ...string) string
- type Admin
- func (a *Admin) AddMongoDB(uri, nodetype, replset, cluster string) error
- func (a *Admin) AddMySQL(info map[string]string, mf MySQLFlags) error
- func (a *Admin) AddOS() error
- func (a *Admin) AddQueries(info map[string]string) error
- func (a *Admin) CheckNetwork(noEmoji bool) error
- func (a *Admin) List() error
- func (a *Admin) LoadConfig(filename string) error
- func (a *Admin) PrintInfo()
- func (a *Admin) RemoveMongoDB(name string) error
- func (a *Admin) RemoveMySQL(name string) error
- func (a *Admin) RemoveOS(name string) error
- func (a *Admin) RemoveQueries(name string) error
- func (a *Admin) ServerAlive() bool
- func (a *Admin) SetAPI()
- func (a *Admin) SetConfig(serverAddress, clientAddress, clientName string) error
- func (a *Admin) StartStopAllMonitoring(action string) (error, bool)
- func (a *Admin) StartStopMonitoring(action, metric, name string) error
- type Config
- type MySQLFlags
Constants ¶
const (
PMMBaseDir = "/usr/local/percona/pmm-client"
)
Variables ¶
var (
ConfigFile = fmt.Sprintf("%s/pmm.yml", PMMBaseDir)
)
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.
Types ¶
type Admin ¶
type Admin struct { ServiceName string ServicePort uint Config *Config // contains filtered or unexported fields }
Main class.
func (*Admin) AddMongoDB ¶
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) AddQueries ¶
AddQueries add mysql instance to QAN.
func (*Admin) CheckNetwork ¶
CheckNetwork check connectivity between client and server.
func (*Admin) LoadConfig ¶
LoadConfig read PMM client config file.
func (*Admin) RemoveMongoDB ¶
RemoveMongoDB remove mongodb service from monitoring.
func (*Admin) RemoveMySQL ¶
RemoveMySQL remove mysql services from monitoring.
func (*Admin) RemoveQueries ¶
RemoveQueries remove mysql instance from QAN.
func (*Admin) ServerAlive ¶
ServerAlive check if PMM server is alive.
func (*Admin) SetConfig ¶
SetConfig configure PMM client with server and client addresses, write them to the config.
func (*Admin) StartStopAllMonitoring ¶
StartStopAllMonitoring start/stop all metric services.
func (*Admin) StartStopMonitoring ¶
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.