myStatusgo

command module
v0.0.0-...-679c094 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 22 Imported by: 0

README

myStatusgo

myStatusgo is a realtime monitoring tool for MySQL with status information,performance schema(MySQL5.6+) and etc..(terminal base) This tool can monitor multiple MySQL instances.

myStatusgo collects metric and display them.

  1. Normal.. Display QPS info from Com_xx of SHOW GLOBAL STATUS
  2. OS Metric.. Display QPS info and OS metric. OS metric collect from node_expoter when the MySQL server installed node_expoter
  3. Threads.. Display Running Threads from performance_schema.threads table. (MySQL5.6+)
  4. P_S Info.. Display digest_text from performance_schema.statement_digest table (MySQL5.6+)
  5. SlaveStatus.. Display Slave Info from SHOW SLAVE STATUS
  6. Handler/InnoDB_Rows.. Display innodb_row_xx and Handler_xx from SHOW GLOBAL STATUS
  7. InnoDB Lock Info.. Display InnoDB Row Lock Info from information_schema.innodb_trx and innodb_locks and innodb_lock_waits (MySQL5.6+)
  8. InnoDB Buffer Info.. Display InnoDB Buffer Pool Info from information_schema.INNODB_METRICS (MySQL5.6+)
  9. Table IO Statistic.. Display information of I/O request of each table and information on the number of SELECT/DML for each table from performance_schema.file_summary_by_instance and performance_schema.table_io_waits_summary_by_table (MySQL5.6+)

Grants

myStatusgo needs following permissions user

GRANT SELECT on performance_schema.* to 'user'@'host';
GRANT PROCESS,REPLICATION CLIENT on *.* to 'user'@'host';

Install

go get -u github.com/kenken0807/myStatusgo

The binary will be builted and installed into $GOPATH/bin/.

Quick Start

$ myStatusgo -hc Hostname:Port[:alias],Hostname:Port[:alias] -u User -p Password

Example $ myStatusgo -hc 192.168.0.1:3306:Master,192.168.0.2:3306:Slave1 -u user1 -p userpass

oss_sample_qps

How to specify Hostname

There are three ways to specify hosts.

  • -h option JSON format
$ myStatusgo -h '{"ServiceList":[{"serviceName":"Sample","host":["192.168.0.1:3306","192.168.0.2:3306"]}]}'
  • -hc option Comma separated
$ myStatusgo -hc 192.168.0.1:3306,192.168.0.2:3306
  • Specify a file as an argument
$ vim hostlist
# Sample
192.168.0.1:3306
192.168.0.2:3306

$ myStatusgo hostlist

Options

Usage of myStatusgo:
  -a	Show All metrics per server
  -c int
    	Seconds of Automatic Stopping
  -d int
    	Delay between updates in seconds (default 1)
  -g	Gtid Mode at 5:SlaveStatus
  -h string
    	Hostlist written JSON
  -hc string
    	Hostlist written Comma separated
  -j	Write as JSON to file with option -o
  -m int
    	Start Mode 1:Normal 2:OSResource 3:Threads 4:PerformaceSchema 5:SlaveStatus 6:Handler/InnoDB_Rows 7:InnoDBLockInfo 8.InnoDB Buffer Info 9.Table IO Statistic (default 1)
  -n int
    	node_exporter port
  -o string
    	Write the content to file and will set autostop 3600 secs
  -p string
    	MySQL Password
  -t int
    	The number of display per instance of Threads ,Performance Schema and Table IO Statistic  (default 10)
  -u string
    	MySQL Username
  -v	Show Version

Other

  • -n port option Also display OS metrics info if MySQL server has node exporter
$ myStatusgo -h '{"ServiceList":[{"serviceName":"Sample","host":["192.168.0.1:3306:Master","192.168.0.2:3306:Slave1","192.168.0.3:3306:Slave2"]}]}' -u test -p test -n 9100

oss_sample qpsos

  • -t number option(default 10) The number of display per instance of Threads ,Performance Schema and Table IO Statistic

oss_psinfo

  • -a Option show all metrics which retrieved by myStatusgo per server allmetrics

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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