Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --tag option to specify tags #2

Merged
merged 1 commit into from Oct 21, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/riemann/tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def options
opt :host, "Riemann host", :default => '127.0.0.1'
opt :port, "Riemann port", :default => 5555
opt :interval, "Seconds between updates", :default => 5
opt :tag, "Tag to add to events", :type => String, :multi => true
end
end

Expand All @@ -52,6 +53,10 @@ def opt(*a)
end

def report(event)
if options[:tag]
event[:tags] = options[:tag]
end

riemann << event
end

Expand Down