Class: VPNProxyCheck

Inherits:
GaddyGaddyCheck show all
Defined in:
lib/gg_check/plugins/VPNProxy.rb

Direct Known Subclasses

VPNEasyCheck

Instance Method Summary collapse

Methods inherited from GaddyGaddyCheck

#extra, #initialize, #process_alive?, #run_cmd, #socket

Constructor Details

This class inherits a constructor from GaddyGaddyCheck

Instance Method Details

#status(options) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'lib/gg_check/plugins/VPNProxy.rb', line 6

def status(options)
  check_result = {}
  result = `curl --write-out "%{http_code}" --socks5 127.0.0.1:1080 www.google.com -o /dev/null --silent`
  check_result['status'] = (result.index('000').nil? && $?.success?) ? 0 : 2      # Test mode!!!!
  if check_result['status'] != 0
    check_result['message_key'] = 'event.vpn_proxy.no_connection'
  end
  check_result
end