Last active
December 11, 2015 18:59
-
-
Save YoshihitoAso/4645765 to your computer and use it in GitHub Desktop.
fluent-plugin-cloudwatch_ya のセッティング方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//AWS SDK for Ruby | |
# /usr/lib64/fluent/ruby/bin/gem install aws-sdk | |
//JsonPath | |
# /usr/lib64/fluent/ruby/bin/gem install jsonpath | |
//fluent-plugin-cloudwatch_ya | |
# /usr/lib64/fluent/ruby/bin/gem install fluent-plugin-cloudwatch_ya | |
//how to use | |
# yum -y install dstat | |
# /usr/lib64/fluent/ruby/bin/gem install fluent-plugin-dstat | |
--examples(need IAM Role) | |
# cat /etc/td-agent/td-agent.conf | |
<source> | |
type dstat | |
tag dstat | |
option -l | |
delay 60 | |
</source> | |
<match dstat> | |
type copy | |
<store> | |
type file | |
path /tmp/dstat | |
</store> | |
<store> | |
type cloudwatch_ya | |
buffer_type file | |
buffer_path /opt/suz-lab/var/lib/td-agent/buf/cloudwatch.dstat | |
flush_interval 1m | |
cloud_watch_endpoint monitoring.ap-northeast-1.amazonaws.com | |
namespace SUZ-LAB/TEST | |
<metric> | |
metric_name LoadAvg1m | |
value_key $['dstat']['load avg']['1m'] | |
unit None | |
outcast_no_dimension_metric yes | |
<dimensions> | |
instance_id yes | |
</dimensions> | |
</metric> | |
</store> | |
</match> | |
# chown -R td-agent.td-agent /opt/suz-lab/var/lib/td-agent | |
# /etc/init.d/td-agent start | |
--debug | |
# cat /etc/sysconfig/td-agent | |
TD_AGENT_ARGS="/usr/sbin/td-agent --user td-agent --group td-agent --log /var/log/td-agent/td-agent.log -vv" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment