site24x7_apminsight 1.8.6 → 1.8.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ require 'agent/version'
7
7
 
8
8
  module ManageEngine
9
9
  class APMConfig
10
- attr_reader :agenthost,:agentport,:instance_id,:alreadyconnected,:apmhost,:apmport,:license_key,:site24x7, :site24x7url, :hostType
10
+ attr_reader :agenthost,:agentport,:instance_id,:alreadyconnected,:apmhost,:apmport,:license_key,:site24x7, :site24x7url, :hostType,:delayedStart
11
11
  attr_reader :appname,:proxyneeded, :apdex_t, :trans_trace, :trans_trace_t, :sql_capture, :sql_capture_params, :sql_trace_t,:proxy_user,:proxy_pass, :metric_overflow_t, :trace_overflow_t, :dbmetric_overflow_t
12
12
  attr_reader :proxy_host,:proxy_port ,:is_secured, :logs_dir ,:connection_retry,:agent_enabled,:connect_interval,:db_operations,:txn_skip_listen, :url_merge_pattern
13
13
  attr_accessor :app_db,:app_dispatcher,:lastupdatedtime
@@ -54,7 +54,7 @@ module ManageEngine
54
54
 
55
55
  def configureFile
56
56
  begin
57
- if(FileTest.exists?(@obj.constants.apm_conf))
57
+ if(FileTest.exist?(@obj.constants.apm_conf))
58
58
  #conf file exists in APPlication Home
59
59
  @obj.log.debug "Config File Exists. It is read from #{@obj.constants.apm_conf}"
60
60
  @config = @obj.util.readProperties(@obj.constants.apm_conf)
@@ -98,7 +98,7 @@ module ManageEngine
98
98
  end
99
99
 
100
100
  def checkAgentInfo
101
- if FileTest.exists?(@obj.constants.agent_conf)
101
+ if FileTest.exist?(@obj.constants.agent_conf)
102
102
  @obj.log.debug "Status : Agent Already Connected"
103
103
  props = @obj.util.readProperties(@obj.constants.agent_conf)
104
104
  instance_id = props["agent.id"]
@@ -134,7 +134,7 @@ module ManageEngine
134
134
  def urlMergePattern
135
135
  @url_merge_pattern = Hash.new
136
136
  begin
137
- if (FileTest.exists?(@obj.constants.mergepattern_conf))
137
+ if (FileTest.exist?(@obj.constants.mergepattern_conf))
138
138
  @url_merge_pattern=@obj.util.readProperties(@obj.constants.mergepattern_conf)
139
139
  end
140
140
  rescue Exception => e
@@ -171,6 +171,7 @@ module ManageEngine
171
171
  @dbmetric_overflow_t=500
172
172
  @trace_overflow_t=30
173
173
  @site24x7url = @obj.constants.site24x7USurl #default agent communication URL
174
+ @delayedStart = false
174
175
  end
175
176
 
176
177
  def assignConfig
@@ -212,6 +213,7 @@ module ManageEngine
212
213
  when "metricstore.metric.bucket.size" then @metric_overflow_t = isInteger(@metric_overflow_t, value)
213
214
  when "metricstore.dbmetric.bucket.size" then @dbmetric_overflow_t = isInteger(@dbmetric_overflow_t, value)
214
215
  when "transaction.tracestore.size" then @trace_overflow_t = isInteger(@trace_overflow_t, value)
216
+ when "agent.delay.start" then @delayedStart=@obj.util.getBooleanValue value
215
217
  end
216
218
  end
217
219
  store_encrypted_data(@config)
@@ -40,7 +40,7 @@ module ManageEngine
40
40
  def getLogsPath
41
41
  props = {}
42
42
  begin
43
- if FileTest.exists?(@obj.constants.apm_conf)
43
+ if FileTest.exist?(@obj.constants.apm_conf)
44
44
  propsFile=File.open(@obj.constants.apm_conf, 'r')
45
45
  propsFile.read.each_line do |line|
46
46
  line.strip!
@@ -9,7 +9,16 @@ module ManageEngine
9
9
  def initialize
10
10
  @obj = ManageEngine::APMObjectHolder.instance
11
11
  @obj.log.debug "Agent Initialization - START"
12
- doConnect
12
+ if @obj.config.delayedStart
13
+ @obj.log.info "Delaying agent handshake as per configuration.."
14
+ @obj.agent_initialized = true # to be reset when connecting
15
+ @apm = Thread.new do
16
+ sleep ((@obj.config.connect_interval).to_i)/2
17
+ doConnect
18
+ end
19
+ else
20
+ doConnect
21
+ end
13
22
 
14
23
  if !@obj.shutdown && @obj.agent_initialized
15
24
  @obj.log.info "Agent Initialization - DONE"
@@ -26,12 +35,12 @@ module ManageEngine
26
35
  #@obj.instrumenter.doUnSubscribe
27
36
  @obj.shutdownagent
28
37
  end
29
-
30
-
31
- end
38
+ end
32
39
 
33
40
  def doConnect
34
41
  begin
42
+ @obj.agent_initialized=false #resetting, to go with the flow
43
+
35
44
  if @obj.shutdown
36
45
  @obj.log.info "[ Problem in Agent Startup ]"
37
46
  else
@@ -19,7 +19,7 @@ module ManageEngine
19
19
 
20
20
  u = url uri
21
21
  #@obj.log.info "[connector] [ POST] START"
22
- @obj.log.debug "[connector] [ POST] : \n\n#{u}\n\n#{data}\n\n"
22
+ @obj.log.debug "[connector] [ POST] : #{u}\n#{data}"
23
23
  con = connection(u)
24
24
  req = Net::HTTP::Post.new(u.request_uri,initheader = {'Content-Type' =>'application/json'})
25
25
  req.body=data.to_json
@@ -23,10 +23,10 @@ class APMWorker
23
23
  @apm = Thread.new do
24
24
  @status = 'working'
25
25
  while !@obj.shutdown do
26
+ sleep (@obj.config.connect_interval).to_i
26
27
  checkforagentstatus
27
28
  updateConfig
28
29
  dc
29
- sleep (@obj.config.connect_interval).to_i
30
30
  end#w
31
31
  @status= "end"
32
32
  @obj.log.debug "Worker thread ends"
@@ -50,22 +50,21 @@ module ManageEngine
50
50
  props = {}
51
51
  begin
52
52
  propsFile=File.open(filepath, 'r')
53
- propsFile.read.each_line do |line|
54
- line.strip!
55
- if (line[0] != ?# and line[0] != ?=)
56
- i = line.index('=')
57
- if (i)
58
- props[line[0..i - 1].strip] = line[i + 1..-1].strip
59
- else
60
- props[line] = ''
61
- end
62
- end
63
- end
53
+ propsFile.read.each_line do |line|
54
+ line.strip!
55
+ if (line[0] != ?# and line[0] != ?=)
56
+ i = line.index('=')
57
+ if (i)
58
+ props[line[0..i - 1].strip] = line[i + 1..-1].strip
59
+ else
60
+ props[line] = ''
61
+ end
62
+ end
63
+ end
64
+ propsFile.close
64
65
  rescue Exception=>e
65
66
  @log.info "Problem in Reading Property File : #{e.message} "
66
67
  @log.error "#{e.backtrace}"
67
- ensure
68
- propsFile.close
69
68
  end
70
69
  props
71
70
  end
data/lib/agent/version.rb CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  module ManageEngine
8
8
  class APMInsight
9
- VERSION = '1.8.6'
9
+ VERSION = '1.8.7'
10
10
  MAJOR_VERSION = '1.8'
11
- MINOR_VERSION = '6'
11
+ MINOR_VERSION = '7'
12
12
  end
13
13
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 8
8
- - 6
9
- version: 1.8.6
8
+ - 7
9
+ version: 1.8.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adithyan P
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2022-08-26 00:00:00 +05:30
17
+ date: 2023-07-05 00:00:00 +05:30
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency