nfagent 0.9.13 → 0.9.15

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -16,6 +16,7 @@ lib/nfagent/client.rb
16
16
  lib/nfagent/client_response.rb
17
17
  lib/nfagent/config.rb
18
18
  lib/nfagent/tail.rb
19
+ lib/nfagent/tests.rb
19
20
  lib/nfagent/submitter.rb
20
21
  bin/nfagent
21
22
  bin/squid_log_writer
data/lib/nfagent.rb CHANGED
@@ -28,7 +28,8 @@ require 'nfagent/tail'
28
28
  require 'nfagent/event'
29
29
  require 'nfagent/server'
30
30
  require 'nfagent/cli'
31
+ require 'nfagent/tests'
31
32
 
32
33
  module NFAgent
33
- VERSION = '0.9.13'
34
+ VERSION = '0.9.15'
34
35
  end
data/lib/nfagent/cli.rb CHANGED
@@ -5,6 +5,10 @@ module NFAgent
5
5
 
6
6
  def initialize
7
7
  Config.load_and_parse
8
+ if Config.test_mode?
9
+ Tests.run
10
+ exit 1
11
+ end
8
12
  @process = ProcessManager.new(Server)
9
13
  @process.start
10
14
  end
@@ -3,7 +3,7 @@ module NFAgent
3
3
  SERVICE_HOST = "collector.service.netfox.com"
4
4
 
5
5
  def self.post(end_point, data_hash)
6
- proxy_class = Net::HTTP::Proxy(Config.proxy.host, Config.proxy.port, Config.proxy.user, Config.proxy.password)
6
+ proxy_class = Net::HTTP::Proxy(Config.http_proxy_host, Config.http_proxy_port, Config.http_proxy_user, Config.http_proxy_password)
7
7
  # TODO: Enable SSL
8
8
  proxy_class.start(SERVICE_HOST, 80) do |http|
9
9
  http.read_timeout = 120 # 2 minutes TODO: Make this a config option with 120 as default
@@ -1,15 +1,11 @@
1
1
  module NFAgent
2
- class Proxy
3
- attr_accessor :host, :port, :user, :password
4
- end
5
-
6
2
  RBConfig = Config
7
3
 
8
4
  class Config < SVUtil::Config
9
- @@proxy = Proxy.new
5
+ @@test_mode = false
10
6
 
11
- def self.proxy
12
- @@proxy
7
+ def self.test_mode?
8
+ @@test_mode
13
9
  end
14
10
 
15
11
  class << self
@@ -31,6 +27,9 @@ module NFAgent
31
27
  opts.on("-D", "--dump-dir [dir]", "Dump directory for failed chunks") do |dir|
32
28
  Config.dump_dir = dir
33
29
  end
30
+ opts.on("-T", "--test", "Run connection tests") do
31
+ @@test_mode = true
32
+ end
34
33
  end
35
34
  end
36
35
  end
@@ -0,0 +1,8 @@
1
+ module NFAgent
2
+ class Tests
3
+ def self.run
4
+ poller = Poller.new
5
+ poller.send_heartbeat
6
+ end
7
+ end
8
+ end
data/nfagent.conf CHANGED
@@ -1,5 +1,4 @@
1
1
  client_key = 1234
2
- proxy_log = /tmp/access.log
3
2
  dump_dir = /tmp/dumps
4
3
  log_file = /tmp/debug
5
4
  pid_file = /tmp/nfagent.pid
@@ -12,8 +12,6 @@
12
12
  set -e
13
13
  . /lib/lsb/init-functions
14
14
 
15
- # /etc/init.d/pgship: start and stop the PGShip WAL Shipping Service
16
-
17
15
  NFAGENT_OPTS="-f /etc/nfagent.conf -d"
18
16
  NFAGENT_PID="/var/run/nfagent.pid"
19
17
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 13
9
- version: 0.9.13
8
+ - 15
9
+ version: 0.9.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Draper
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-03 00:00:00 +09:30
17
+ date: 2010-10-27 00:00:00 +10:30
18
18
  default_executable: nfagent
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -68,9 +68,9 @@ dependencies:
68
68
  - !ruby/object:Gem::Version
69
69
  segments:
70
70
  - 2
71
- - 6
71
+ - 4
72
72
  - 0
73
- version: 2.6.0
73
+ version: 2.4.0
74
74
  type: :development
75
75
  version_requirements: *id004
76
76
  description: Logging Agent for NetFox Online
@@ -105,6 +105,7 @@ files:
105
105
  - lib/nfagent/client_response.rb
106
106
  - lib/nfagent/config.rb
107
107
  - lib/nfagent/tail.rb
108
+ - lib/nfagent/tests.rb
108
109
  - lib/nfagent/submitter.rb
109
110
  - bin/nfagent
110
111
  - bin/squid_log_writer