Skip to content

Commit

Permalink
First attempt at ganglia/gmetric output
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuchbinder committed Jul 23, 2011
1 parent 6673290 commit 5001aa2
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- feature: new redis 'pattern_channel' input support for PSUBSCRIBE
- feature: new output plugin "graphite" for taking metrics from events and
shipping them off to your graphite/carbon server.
- feature: new output plugin "ganglia" for shipping metrics to ganglia
gmond server.

1.0.14 (Jul 1, 2011)
- feature: new output plugin "loggly" which lets you ship logs to loggly.com
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ gem "mongo" # outputs/mongodb, License: Apache 2.0
gem "redis" # outputs/redis, License: MIT-style
gem "gelf" # outputs/gelf, # License: MIT-style
gem "statsd-ruby", "~> 0.3.0" # outputs/statsd, # License: As-Is
gem "gmetric", "~> 0.1.3" # outputs/ganglia, # License: MIT

# For testing/dev
group :development do
Expand Down
3 changes: 3 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ For the web interface:
- haml
- sass

For ganglia reporting:
- gmetric

# For 'jls-grok' you will need grok installed.
Install the following packages (centos: sudo yum install pkgname)
pcre-devel, libevent-devel, gperf
Expand Down
53 changes: 53 additions & 0 deletions lib/logstash/outputs/ganglia.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
require "logstash/outputs/base"
require "logstash/namespace"
require "gmetric"

# This output allows you to pull metrics from your logs and ship them to
# ganglia's gmond. This is heavily based on the graphite output.
class LogStash::Outputs::Ganglia < LogStash::Outputs::Base
config_name "ganglia"

# The address of the graphite server.
config :host, :validate => :string, :default => "localhost"

# The port to connect on your graphite server.
config :port, :validate => :number, :default => 8649

# The metric to use. This supports dynamic strings like %{@source_host}
config :metric, :validate => :string, :required => true

# The value to use. This supports dynamic strings like %{bytes}
# It will be coerced to a floating point value. Values which cannot be
# coerced will zero (0)
config :value, :validate => :string, :required => true

# Gmetric type
config :type, :validate => :string, :default => "uint8"

# Gmetric units for metric
config :units, :validate => :string, :default => ""

# Timing values, can be left alone
config :tmax, :validate => :number, :default => 60
config :dmax, :validate => :number, :default => 300

def register
# No register action required, stateless
end # def register

def connect
# No "connect" action required, stateless
end # def connect

public
def receive(event)
Ganglia::GMetric.send(@host, @port, {
:name => @metric,
:units => @units,
:type => @type,
:value => @value,
:tmax => @tmax,
:dmax => @dmax
})
end # def receive
end # class LogStash::Outputs::Ganglia
1 change: 1 addition & 0 deletions logstash.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "mongo" # outputs/mongodb
spec.add_dependency "gelf" # outputs/gelf
spec.add_dependency "statsd-ruby" # outputs/statsd
spec.add_dependency "gmetric" # outputs/ganglia

# For the 'grok' filter
spec.add_dependency("jls-grok", "~> 0.4.7")
Expand Down

0 comments on commit 5001aa2

Please sign in to comment.