开源监控解决方案:zabbix 监控mysql database(Golang)

栏目: Go · 发布时间: 6年前

[root@amb01 ~]# tar zxvf binutils-2.27.tar.gz
[root@amb01 ~]# cd binutils-2.27
[root@amb01 binutils-2.27]# make
[root@amb01 binutils-2.27]# make install

[root@amb01 ~]# tar -zxvf go1.4-bootstrap-20171003.tar.gz
[root@amb01 ~]# cd go/src
[root@amb01 src]# ./make.bash
[root@amb01 ~]# mv ~/go ~/go1.4
[root@amb01 ~]# export GOROOT_BOOTSTRAP=~/go1.4

[root@amb01 ~]# tar zxvf go-go1.10.3.tar.gz
[root@amb01 ~]# cd go-go1.10.3/src
[root@amb01 src]# ./all.bash
[root@amb01 ~]# mv ~/go-go1.10.3 /usr/local/go

[root@amb01 ~]# mkdir /home/go

[root@amb01 ~]# vi /etc/profile
export PATH=$PATH:/usr/local/go/bin
export GOPATH=/home/go

[root@amb01 ~]# go version
go version go1.10.3 linux/amd64


https://github.com/go-sql-driver/mysql
[root@amb01 ~]# unzip mysql-master.zip 
[root@amb01 ~]# mkdir -p /home/go/src/github.com/go-sql-driver/mysql
[root@amb01 ~]# cp mysql-master/* /home/go/src/github.com/go-sql-driver/mysql/

https://github.com/actiontech/actiontech_zabbix_mysql_monitor
[root@amb01 ~]# unzip actiontech_zabbix_mysql_monitor-master.zip
[root@amb01 ~]# cd actiontech_zabbix_mysql_monitor-master
[root@amb01 actiontech_zabbix_mysql_monitor-master]# chmod a+x *.sh
[root@amb01 actiontech_zabbix_mysql_monitor-master]# ./build.sh 
[root@amb01 actiontech_zabbix_mysql_monitor-master]# ./actiontech_mysql_monitor --help  
Usage of ./actiontech_mysql_monitor:
  -cache_dir path
        A path for saving cache. if change, make sure change the wrapper.sh file too. (default "/tmp")
  -debug_log debuglog
        If debuglog is a filename, it'll be used. (default: no default)
  -discovery_port discovery mysqld port
        discovery mysqld port, print in json format (default: false)
  -get_qrt_mysql
        Whether to get response times from MySQL (default: false)
  -get_qrt_percona
        Whether to get response times from Percona Server or MariaDB (default true)
  -heartbeat
        Whether to use pt-heartbeat table for repl. delay calculation. (default: false)
  -heartbeat_server_id Server id
        Server id to associate with a heartbeat. Leave 0 if no preference. (default: 0)
  -heartbeat_table db.tbl
        db.tbl. (default "percona.heartbeat")
  -heartbeat_utc
        Whether pt-heartbeat is run with --utc option. (default: false)
  -host MySQL host
        MySQL host (default "127.0.0.1")
  -innodb
        Whether to check InnoDB statistics (default true)
  -items item
        -items <item,...> Comma-separated list of the items whose data you want (default: no default)
  -master
        Whether to check binary logging (default true)
  -nocache
        Do not cache results in a file (default: false)
  -pass MySQL password
        MySQL password (default: no default)
  -poll_time polling interval
        Adjust to match your polling interval.if change, make sure change the wrapper.sh file too. (default 30)
  -port MySQL port
        MySQL port (default "3306")
  -procs
        Whether to check SHOW PROCESSLIST (default true)
  -slave
        Whether to check slave status (default true)
  -sudo sudo netstat...
        Use sudo netstat... (default true)
  -user MySQL username
        MySQL username (default: no default)
  -version
        print version

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

影响力

影响力

[美] 罗伯特·西奥迪尼 / 陈叙 / 中国人民大学出版社 / 2006-5 / 45.00元

政治家运用影响力来赢得选举,商人运用影响力来兜售商品,推销员运用影响力诱惑你乖乖地把金钱捧上。即使你的朋友和家人,不知不觉之间,也会把影响力用到你的身上。但到底是为什么,当一个要求用不同的方式提出来时,你的反应就会从负面抵抗变成积极合作呢? 在这本书中,心理学家罗伯特·B·西奥迪尼博士为我们解释了为什么有些人极具说服力,而我们总是容易上当受骗。隐藏在冲动地顺从他人行为背后的6大心理秘笈,正是......一起来看看 《影响力》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具