Fluent::Plugin::CloudStack

Fluentd input plugin to get usages and events from CloudStack API.

  • usages
    • instance_sum
    • memory_sum
    • root_volume_sum
    • data_volume_sum
    • usages_per_service_offering
    • usages_per_disk_offering
  • event
    • event_log
    • events_flow(per interval)

Installation

Add this line to your application’s Gemfile:


gem 'fluent-plugin-cloudstack'

Or install it yourself as:


$ gem install fluent-plugin-cloudstack

Or use td-agent : (on Ubuntu12.04)


$ sudo /usr/lib/fluent/ruby/bin/fluent-gem install fluent-plugin-cloudstack

Configuration


<source>
  type cloudstack
  host $cloudtack_host
  apikey $cloudstack_apikey
  secretkey $cloustack_secretkey

  # optional
  protocol $cloudstack_protocol_scheme # https or http, default https
  path $cloudstack_path                # default /client/api
  port $cloudstack_port                # default 443
  interval $get_interval_sec           # default 300, min 300(exclude debug_mode)
  ssl $cloudtack_api_ssl               # true or false, default true
  domain_id $cloudstack_domain_id
  tag $fluentd_tag                     # default cloudstack
  log_dir $fluentd_log_dir             # default /var/log/td_agent

  # debug mode
  debug_mode $boolean                  # default false
</source>

Usage Sample

https://github.com/u-ichi/fluent-plugin-cloudstack-sample

Data Example


20130507T041336+0000    cloudstack.event        {"id":"xxxxxxx-4e64-4fa5-8045-5ecffb7e2417",
                                                 "username":"clnxxxxxxxxx",
                                                 "type":"USER.LOGIN",
                                                 "level":"INFO",
                                                 "description":"user has logged in from IP Address xxx.xxx.xxx.xxx",
                                                 "account":"clnxxxxxxx",
                                                 "domainid":"xxxxxxxx-dcc3-486b-90e8-02c514c93d1f",
                                                 "domain":"cln10000004",
                                                 "created":"2013-05-07T13:13:36+0900",
                                                 "state":"Completed",
                                                 "parentid":"0"}

20131028T133511+0000    cloudstack.usages       {"vm_sum":1,
                                                 "cpu_sum":1,
                                                 "memory_sum":536870912,
                                                 "root_volume_sum":16106127360,
                                                 "data_volume_sum":42949672960,
                                                 "t1.micro":1,
                                                 "Datadisk_40GB":1}
20131028T133511+0000    cloudstack.usages       {"events_flow":5}