2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mackerel-agent-plugins/mackerel-plugin-mysqlを使う

2
Last updated at Posted at 2017-12-09

さいしょに

CentOS7でmackerel-agentを使い始めることから、同一ホスト内のmariadbの状況を知りたいと思って、mackerel-plugin-mysqlを動かすまでを書きます。

environment

  • CentOS 7.4
  • mariadb-server

setup

console
# ifconfig入ってなかったら入れる
$ sudo yum install -y net-tools

# mackerelのページの通りに入れる
$ curl -fsSL https://mackerel.io/file/script/setup-all-yum-v2.sh | MACKEREL_APIKEY='___KEY___' sh
$ sudo journalctl -u mackerel-agent.service

# mariadbを入れて起動する
$ sudo yum install -y mariadb mariadb-server
$ sudo systemctl start mariadb.service

install mackerel-plugins

console
# mackerel pluginsを入れる
$ sudo yum install -y mackerel-agent-plugins


# mackerel-agentのdefault configのパスを調べる(-conf string)
$ mackerel-agent -h

$ touch /etc/mackerel-agent/mackerel-plugin-mysql
# 下記の要否は分からない
$ chmod +x /etc/mackerel-agent/mackerel-plugin-mysql


# pluginをconfに関連付けて有効にする(内容は下記参照)
$ sudo vi /etc/mackerel-agent/mackerel-agent.conf
$ sudo vi /etc/mackerel-agent/mackerel-plugin-mysql

# 念のため、mackerel-agentを再起動する
$ sudo systemctl restart mackerel-agent.service
/etc/mackerel-agent/mackerel-agent.conf
apikey = "___KEY___"
...
...
# command = "ruby /etc/sensu/plugins/http/metrics-curl.rb"
[plugin.metrics.mysql]
command = "/etc/mackerel-agent/mackerel-plugin-mysql"
/etc/mackerel-agent/mackerel-plugin-mysql
mackerel-plugin-mysql -host=localhost -username=root -password=''

wait some minutes ..

mackerelの当該hostのメトリクスが一気に増える。
(MySQL innodb Memory Allocationあたりのグラフがmariadbが消費しているメモリの量として考えられるのかは分からない。)

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?