diff options
author | Saku Ytti <saku@ytti.fi> | 2013-04-26 17:03:01 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2013-04-26 17:03:01 +0300 |
commit | b30ca8b31e23ea9f518c92e2ef51f85d8e7a0584 (patch) | |
tree | 3b93d10cd9b005a1457ec7a8dcc862baa19d05c7 /lib/oxidized | |
parent | d4e251b42ff4f4831762912e2ad3d50b91e8afb0 (diff) |
Fix: telnet exceptions, broken json/ext, typo
Kudos to Samer Abdel-Hafez for noticing
Diffstat (limited to 'lib/oxidized')
-rw-r--r-- | lib/oxidized/api/rest.rb | 3 | ||||
-rw-r--r-- | lib/oxidized/input/telnet.rb | 2 | ||||
-rw-r--r-- | lib/oxidized/node.rb | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/oxidized/api/rest.rb b/lib/oxidized/api/rest.rb index 9e00837..783b445 100644 --- a/lib/oxidized/api/rest.rb +++ b/lib/oxidized/api/rest.rb @@ -5,6 +5,7 @@ module Oxidized class Rest module Helpers def send res, msg='OK', status=200 + msg = {:result => msg} res['Content-Type'] = 'application/json' res.status = status res.body = JSON.dump msg @@ -15,7 +16,7 @@ module Oxidized @nodes = nodes addr, port = listen.to_s.split ':' port, addr = addr, nil if not port - @web = WEBrick::HTTPServer.new :BindAddress=>addr, :Port=>port, :Logger=>Log + @web = WEBrick::HTTPServer.new :BindAddress=>addr, :Port=>port, :Logger=>Log, :AccessLog=>[] maps end def work diff --git a/lib/oxidized/input/telnet.rb b/lib/oxidized/input/telnet.rb index 6dae2d6..f946e92 100644 --- a/lib/oxidized/input/telnet.rb +++ b/lib/oxidized/input/telnet.rb @@ -16,7 +16,7 @@ module Oxidized expect password @telnet.puts @node.auth[:password] expect @node.prompt - rescue Errno::ECONNREFUSED, Net::OpenTimeout, Net::ReadTimeout + rescue Errno::ECONNREFUSED, Timeout::Error return false end end diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb index a41fcdc..0b307b7 100644 --- a/lib/oxidized/node.rb +++ b/lib/oxidized/node.rb @@ -26,7 +26,7 @@ module Oxidized status = :success if config break else - status = :no_cconnection + status = :no_connection end end [status, config] |