lib/riemann/babbler/plugin_helpers.rb in riemann-babbler-0.9.4 vs lib/riemann/babbler/plugin_helpers.rb in riemann-babbler-0.9.5

- old
+ new

@@ -18,23 +18,20 @@ out=nil begin timeout_shell = ( plugin.interval * 2 ).to_f/3 Timeout::timeout(timeout_shell) { Open3.popen3(*cmd) do |stdin, stdout, stderr, wait_thread| - - [stdin, stdout, stderr].each{|stream| stream.send('close')} - end } rescue => e helper_error "#{e.class} #{e}\n#{e.backtrace.join "\n"}" end if exit_status.to_i > 0 err = err.chomp if err helper_error(err) elsif out - return out.chomp + return out.strip else # статус 0, вывода stdout нет '' end end