Permalink
Browse files

Fix counters collecting procedure by watchdog.

  • Loading branch information...
1 parent f4e3f61 commit fad4528021bc951cb8988d169018d86064be8759 @sibprogrammer committed Mar 3, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 utils/watchdog/watchdog.rb
@@ -86,7 +86,7 @@ def collect_beancounters(hardware_server)
counters.each do |record|
counter_info = record.split
if counter_info[0] =~ /^\d+:$/
- current_ve_id = counter_info[0].gsub(/[^\d]/, '').to_i
+ current_ve_id = counter_info[0].gsub(/[^\d]/, '')
current_ve = @virtual_servers.find { |ve| ve.identity == current_ve_id }
counter_info.shift
end
@@ -122,7 +122,7 @@ def collect_memory_usage(hardware_server)
counter_info = record.split
next if counter_info.size < 5
- current_ve_id = counter_info[0].to_i
+ current_ve_id = counter_info[0]
current_ve = @virtual_servers.find { |ve| ve.identity == current_ve_id }
if current_ve and current_ve_id == current_ve.identity
@@ -151,7 +151,7 @@ def collect_diskspace(hardware_server)
counter_info = record.split
next if counter_info.size < 4
- current_ve_id = counter_info[0].to_i
+ current_ve_id = counter_info[0]
current_ve = @virtual_servers.find { |ve| ve.identity == current_ve_id }
if current_ve and current_ve_id == current_ve.identity
@@ -179,7 +179,7 @@ def collect_cpu_usage(hardware_server)
counter_info = record.split
next if counter_info.size < 6
- current_ve_id = counter_info[0].to_i
+ current_ve_id = counter_info[0]
current_ve = @virtual_servers.find { |ve| ve.identity == current_ve_id }
if current_ve and current_ve_id == current_ve.identity

0 comments on commit fad4528

Please sign in to comment.