Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Default event hostname #20

Merged
merged 1 commit into from

2 participants

@timshadel

Useful when trying riemann-health on a box to which you don't have access to change the hostname—like Heroku where hostname returns a GUID that's meaningless to you.

@timshadel

I totally agree that the distinction's hard to make; the only problem I have with event-host is that it doesn't seem to like that as a symbol in Ruby.

opt :event-host, "Event hostname", :type => String

Other preferences? Plain :name? :eventhost? I'm open to anything, really. Tell me what you'd like and I'll make the change. :-)

@timshadel timshadel Allow the event host to be set on the command line
Useful when trying `riemann-health` on a box to which you don't
have access to change the hostname—like Heroku where `hostname`
returns a GUID that's meaningless to you.
d07d98b
@timshadel

Odd; force-pushing to my fork seemed to nuke your comments from this PR. Fantastic tip about Trollup allowing --event-host to map to :event_host. Changes made and rebased on your recent merge. :-)

@aphyr
Owner

Thanks so much Tim! I've added you to the contributors file. :+1:

@aphyr aphyr merged commit 7de2572 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 7, 2013
  1. @timshadel

    Allow the event host to be set on the command line

    timshadel authored
    Useful when trying `riemann-health` on a box to which you don't
    have access to change the hostname—like Heroku where `hostname`
    returns a GUID that's meaningless to you.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/riemann/tools.rb
View
3  lib/riemann/tools.rb
@@ -28,6 +28,7 @@ def options
opt :host, "Riemann host", :default => '127.0.0.1'
opt :port, "Riemann port", :default => 5555
+ opt :event_host, "Event hostname", :type => String
opt :interval, "Seconds between updates", :default => 5
opt :tag, "Tag to add to events", :type => String, :multi => true
opt :ttl, "TTL for events", :type => Integer
@@ -62,6 +63,8 @@ def report(event)
event[:ttl] = options[:ttl]
end
+ event[:host] ||= options[:event_host]
+
riemann << event
end
Something went wrong with that request. Please try again.