- Open a named pipe (fifo) in jruby with 'r+' not 'a' (otherwise you get

"illegal seek" exceptions
This commit is contained in:
Jordan Sissel 2011-04-06 01:51:23 -07:00
parent cc211a29da
commit 4d676dc28f

View file

@ -63,8 +63,9 @@ class LogStash::Outputs::Nagios < LogStash::Outputs::Base
@logger.debug({"commandfile" => @commandfile, "nagios_command" => cmd})
begin
File.open(@commandfile, "a") do |f|
f.puts cmd
File.open(@commandfile, "r+") do |f|
f.puts(cmd)
f.flush
end
rescue
@logger.warn(["Skipping nagios output; error writing to command file",