Skip to content

Instantly share code, notes, and snippets.

@mikeda
Created October 22, 2013 00:02
Show Gist options
  • Save mikeda/7093043 to your computer and use it in GitHub Desktop.
Save mikeda/7093043 to your computer and use it in GitHub Desktop.
muninのmysql_プラグインをAWSのRDSに流用する方法を検討中
#!/bin/bash
# muninのmysql_プラグインで複数のRDSを監視するために、ゴニョる
#
# 事前手順
# 1. munin.confにvirtual nodeを追加する
# [rds;rds-test]
# address 127.0.0.1
# use_node_name no
# 2. 処理を移譲するためのプラグインを作成しておく
# mkdir -p /tmp/munin/plugins/
# ln -s /usr/share/munin/plugins/mysql_ /tmp/munin/plugins/mysql01_commands
mysqlconnection="DBI:mysql:mysql;host=rds-test.xxxxxx.ap-northeast-1.rds.amazonaws.com;port=3306"
mysqluser=dbuser
mysqlpassword=dbpassword
if [ "$1" == config ];then
### virtual node用にhost_nameを追加する
echo "host_name rds-test"
munin-run mysql01_commands config --servicedir /tmp/munin/plugins/
else
munin-run mysql01_commands --servicedir /tmp/munin/plugins/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment