forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt at ganglia/gmetric output
- Loading branch information
1 parent
6673290
commit 5001aa2
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
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 |
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