class SqueezeBoxServerCheck

Public Instance Methods

spotify_ok?() click to toggle source
# File lib/gg_check/plugins/SqueezeBoxServer.rb, line 15
def spotify_ok?
  result = `curl -s 127.0.0.1:9005/status.json|grep '"login_error": "No error"'`.strip
  (result.size > 1 && $?.success?)
end
status(options) click to toggle source
# File lib/gg_check/plugins/SqueezeBoxServer.rb, line 20
def status(options)
  check_result = {}
  result = `curl -s 127.0.0.1:9000|grep "<title>Logitech"`.strip
  check_result['status'] = (result.size > 1 && $?.success?) ? 0 : 2
  if check_result['status'] == 0
    if extra.index('spotify') && ! spotify_ok?
      check_result['message_key'] = 'event.spotify_config_not_ok'
      check_result['status'] = 2
    end
  else
    check_result['message_key'] = 'event.not_running'
  end
  check_result
end