lib/riemann/tools.rb in riemann-tools-0.0.8 vs lib/riemann/tools.rb in riemann-tools-0.0.9

- old
+ new

@@ -27,10 +27,12 @@ end 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 + opt :ttl, "TTL for events", :type => Integer end end def initialize super @@ -50,9 +52,17 @@ def opt(*a) @option_parser.opt *a end def report(event) + if options[:tag] + event[:tags] = options[:tag] + end + + if options[:ttl] + event[:ttl] = options[:ttl] + end + riemann << event end def riemann @riemann ||= Riemann::Client.new(