newrelic_f5_plugin 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,10 @@
1
+ * 1.0.3
2
+ - Add Pool statistics:
3
+ - Requests per second
4
+ - Current Connections
5
+ - Connections per second
6
+ - Throughput (In/Out)
7
+
1
8
  * 1.0.2
2
9
  - Removed bundler requirement as it was not needed
3
10
 
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # This gemfile is used in the context of development on this plugin agent.
4
4
 
5
- gem 'newrelic_plugin', '>= 0.2.11'
5
+ gem 'newrelic_plugin', '= 1.0.2'
6
6
  gem 'snmp'
7
7
  gem 'rake', '>0.9.2'
8
8
  gem 'test-unit'
@@ -20,6 +20,12 @@ Virtual Server Statistics
20
20
  * Connections per Second
21
21
  * Inbound and Outbound Throughput
22
22
 
23
+ Pool Statistics
24
+ * Requests per Second
25
+ * Current Connections
26
+ * Connections per Second
27
+ * Inbound and Outbound Throughput
28
+
23
29
 
24
30
  == Requirements
25
31
 
@@ -31,11 +37,11 @@ host also needs Ruby (tested with 1.8.7 and 1.9.3), and support for rubygems.
31
37
 
32
38
  === F5
33
39
 
34
- This plugin has been tested with F5 LTM versions 11.2.x and 11.3.x. Some metrics are reported on
40
+ This plugin has been tested with F5 LTM versions 11.2.x and 11.3.x. Some metrics are reported on
35
41
  10.2.x, but the data is incomplete due to SNMP changes made by F5 between 10 and 11.
36
42
 
37
43
  A *read-only* SNMP community is required for each device to be monitored. Currently, only
38
- SNMP verison 2c is supported.
44
+ SNMP version 2c is supported.
39
45
 
40
46
 
41
47
  == Installation and Running
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'newrelic_f5_plugin/nodes'
3
+ require 'newrelic_f5_plugin/pools'
3
4
  require 'newrelic_f5_plugin/virtuals'
4
5
  require 'newrelic_f5_plugin/agent'
5
6
 
@@ -4,7 +4,7 @@ require 'newrelic_plugin'
4
4
  require 'snmp'
5
5
 
6
6
  module NewRelic::F5Plugin
7
- VERSION = '1.0.2'
7
+ VERSION = '1.0.3'
8
8
 
9
9
  # Register and run the agent
10
10
  def self.run
@@ -87,6 +87,34 @@ module NewRelic::F5Plugin
87
87
  report_counter_metric m, "bits/sec", virtual_throughput_out[m]
88
88
  }
89
89
 
90
+ #
91
+ # Collect pool statistics
92
+ #
93
+ pool = NewRelic::F5Plugin::Pools.new snmp
94
+ pool_requests = pool.get_requests
95
+ pool_requests.each_key { |m|
96
+ report_counter_metric m, "req/sec", pool_requests[m]
97
+ }
98
+
99
+ pool_conns_current = pool.get_conns_current
100
+ pool_conns_current.each_key { |m|
101
+ report_metric m, "conns", pool_conns_current[m]
102
+ }
103
+
104
+ pool_conns_total = pool.get_conns_total
105
+ pool_conns_total.each_key { |m|
106
+ report_counter_metric m, "conn/sec", pool_conns_total[m]
107
+ }
108
+
109
+ pool_throughput_in = pool.get_throughput_in
110
+ pool_throughput_in.each_key { |m|
111
+ report_counter_metric m, "bits/sec", pool_throughput_in[m]
112
+ }
113
+
114
+ pool_throughput_out = pool.get_throughput_out
115
+ pool_throughput_out.each_key { |m|
116
+ report_counter_metric m, "bits/sec", pool_throughput_out[m]
117
+ }
90
118
 
91
119
 
92
120
  snmp.close
@@ -0,0 +1,217 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'newrelic_plugin'
4
+ require 'snmp'
5
+
6
+ # LtmPoolStatEntry
7
+ # ltmPoolStatName LongDisplayString,
8
+ # ltmPoolStatServerPktsIn Counter64,
9
+ # ltmPoolStatServerBytesIn Counter64,
10
+ # ltmPoolStatServerPktsOut Counter64,
11
+ # ltmPoolStatServerBytesOut Counter64,
12
+ # ltmPoolStatServerMaxConns Counter64,
13
+ # ltmPoolStatServerTotConns Counter64,
14
+ # ltmPoolStatServerCurConns CounterBasedGauge64,
15
+ # ltmPoolStatPvaPktsIn Counter64,
16
+ # ltmPoolStatPvaBytesIn Counter64,
17
+ # ltmPoolStatPvaPktsOut Counter64,
18
+ # ltmPoolStatPvaBytesOut Counter64,
19
+ # ltmPoolStatPvaMaxConns Counter64,
20
+ # ltmPoolStatPvaTotConns Counter64,
21
+ # ltmPoolStatPvaCurConns CounterBasedGauge64,
22
+ # ltmPoolStatTotPvaAssistConn Counter64,
23
+ # ltmPoolStatCurrPvaAssistConn CounterBasedGauge64,
24
+ # ltmPoolStatConnqDepth Integer32,
25
+ # ltmPoolStatConnqAgeHead Integer32,
26
+ # ltmPoolStatConnqAgeMax Integer32,
27
+ # ltmPoolStatConnqAgeEma Integer32,
28
+ # ltmPoolStatConnqAgeEdm Integer32,
29
+ # ltmPoolStatConnqServiced Counter64,
30
+ # ltmPoolStatConnqAllDepth Integer32,
31
+ # ltmPoolStatConnqAllAgeHead Integer32,
32
+ # ltmPoolStatConnqAllAgeMax Integer32,
33
+ # ltmPoolStatConnqAllAgeEma Integer32,
34
+ # ltmPoolStatConnqAllAgeEdm Integer32,
35
+ # ltmPoolStatConnqAllServiced Counter64,
36
+ # ltmPoolStatTotRequests Counter64,
37
+ # ltmPoolStatCurSessions CounterBasedGauge64
38
+
39
+
40
+ module NewRelic
41
+ module F5Plugin
42
+
43
+ class Pools
44
+ attr_accessor :pool_names, :snmp_manager
45
+
46
+ OID_LTM_POOLS = "1.3.6.1.4.1.3375.2.2.5"
47
+ OID_LTM_POOL_STAT = "#{OID_LTM_POOLS}.2"
48
+ OID_LTM_POOL_ENTRY = "#{OID_LTM_POOL_STAT}.3.1"
49
+ OID_LTM_POOL_STAT_NAME = "#{OID_LTM_POOL_ENTRY}.1"
50
+ OID_LTM_POOL_STAT_SERVER_BYTES_IN = "#{OID_LTM_POOL_ENTRY}.3"
51
+ OID_LTM_POOL_STAT_SERVER_BYTES_OUT = "#{OID_LTM_POOL_ENTRY}.5"
52
+ OID_LTM_POOL_STAT_SERVER_TOT_CONNS = "#{OID_LTM_POOL_ENTRY}.7"
53
+ OID_LTM_POOL_STAT_SERVER_CUR_CONNS = "#{OID_LTM_POOL_ENTRY}.8"
54
+ OID_LTM_POOL_STAT_TOT_REQUESTS = "#{OID_LTM_POOL_ENTRY}.30"
55
+
56
+
57
+
58
+ #
59
+ # Init
60
+ #
61
+ def initialize(snmp = nil)
62
+ @pool_names = [ ]
63
+
64
+ if snmp
65
+ @snmp_manager = snmp
66
+ else
67
+ @snmp_manager = nil
68
+ end
69
+ end
70
+
71
+
72
+
73
+ #
74
+ # Get the list of Pool names
75
+ #
76
+ def get_names(snmp = nil)
77
+ snmp = snmp_manager unless snmp
78
+
79
+ if snmp
80
+ @pool_names.clear
81
+
82
+ snmp.walk([OID_LTM_POOL_STAT_NAME]) do |row|
83
+ row.each do |vb|
84
+ @pool_names.push(vb.value)
85
+ end
86
+ end
87
+
88
+ return @pool_names
89
+ end
90
+ end
91
+
92
+
93
+
94
+ #
95
+ # Gather Total Requests
96
+ #
97
+ def get_requests(snmp = nil)
98
+ metrics = { }
99
+ index = 0
100
+ snmp = snmp_manager unless snmp
101
+
102
+ if snmp
103
+ get_names(snmp) if @pool_names.empty?
104
+
105
+ snmp.walk([OID_LTM_POOL_STAT_TOT_REQUESTS]) do |row|
106
+ row.each do |vb|
107
+ metrics["Pools/Requests/#{@pool_names[index]}"] = vb.value.to_i
108
+ index += 1
109
+ end
110
+ end
111
+
112
+ return metrics
113
+ end
114
+ end
115
+
116
+
117
+
118
+ #
119
+ # Gather Connection count
120
+ #
121
+ def get_conns_current(snmp = nil)
122
+ metrics = { }
123
+ index = 0
124
+ snmp = snmp_manager unless snmp
125
+
126
+ if snmp
127
+ get_names(snmp) if @pool_names.empty?
128
+
129
+ snmp.walk([OID_LTM_POOL_STAT_SERVER_CUR_CONNS]) do |row|
130
+ row.each do |vb|
131
+ metrics["Pools/Current Connections/#{@pool_names[index]}"] = vb.value.to_i
132
+ index += 1
133
+ end
134
+ end
135
+
136
+ return metrics
137
+ end
138
+ end
139
+
140
+
141
+
142
+ #
143
+ # Gather Connection rate
144
+ #
145
+ def get_conns_total(snmp = nil)
146
+ metrics = { }
147
+ index = 0
148
+ snmp = snmp_manager unless snmp
149
+
150
+ if snmp
151
+ get_names(snmp) if @pool_names.empty?
152
+
153
+ snmp.walk([OID_LTM_POOL_STAT_SERVER_TOT_CONNS]) do |row|
154
+ row.each do |vb|
155
+ metrics["Pools/Connection Rate/#{@pool_names[index]}"] = vb.value.to_i
156
+ index += 1
157
+ end
158
+ end
159
+
160
+ return metrics
161
+ end
162
+ end
163
+
164
+
165
+
166
+ #
167
+ # Gather Throughput Inbound (returns in bits)
168
+ #
169
+ def get_throughput_in(snmp = nil)
170
+ metrics = { }
171
+ index = 0
172
+ snmp = snmp_manager unless snmp
173
+
174
+ if snmp
175
+ get_names(snmp) if @pool_names.empty?
176
+
177
+ snmp.walk([OID_LTM_POOL_STAT_SERVER_BYTES_IN]) do |row|
178
+ row.each do |vb|
179
+ metrics["Pools/Throughput/In/#{@pool_names[index]}"] = (vb.value.to_f * 8)
180
+ index += 1
181
+ end
182
+ end
183
+
184
+ return metrics
185
+ end
186
+ end
187
+
188
+
189
+
190
+ #
191
+ # Gather Throughput Inbound (returns in bits)
192
+ #
193
+ def get_throughput_out(snmp = nil)
194
+ metrics = { }
195
+ index = 0
196
+ snmp = snmp_manager unless snmp
197
+
198
+ if snmp
199
+ get_names(snmp) if @pool_names.empty?
200
+
201
+ snmp.walk([OID_LTM_POOL_STAT_SERVER_BYTES_OUT]) do |row|
202
+ row.each do |vb|
203
+ metrics["Pools/Throughput/Out/#{@pool_names[index]}"] = (vb.value.to_f * 8)
204
+ index += 1
205
+ end
206
+ end
207
+
208
+ return metrics
209
+ end
210
+ end
211
+
212
+
213
+
214
+ end
215
+ end
216
+ end
217
+
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'newrelic_f5_plugin'
16
- s.version = '1.0.2'
17
- s.date = '2013-07-30'
16
+ s.version = '1.0.3'
17
+ s.date = '2013-09-10'
18
18
  s.rubyforge_project = 'newrelic_f5_plugin'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -51,7 +51,7 @@ This is the New Relic plugin for monitoring F5 devices developed by New Relic, I
51
51
  ## The newrelic_plugin needs to be installed. Prior to public release, the
52
52
  # gem needs to be downloaded from git@github.com:newrelic-platform/newrelic_plugin.git
53
53
  # and built using the "rake build" command
54
- s.add_dependency('newrelic_plugin', ">= 0.2.11")
54
+ s.add_dependency('newrelic_plugin', "= 1.0.2")
55
55
  s.add_dependency('snmp', ">= 1.1.0")
56
56
 
57
57
  s.post_install_message = <<-EOF
@@ -76,6 +76,7 @@ to find out how to install and run the plugin agent.
76
76
  lib/newrelic_f5_plugin.rb
77
77
  lib/newrelic_f5_plugin/agent.rb
78
78
  lib/newrelic_f5_plugin/nodes.rb
79
+ lib/newrelic_f5_plugin/pools.rb
79
80
  lib/newrelic_f5_plugin/virtuals.rb
80
81
  newrelic_f5_plugin.gemspec
81
82
  test/f5_monitor_test.rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_f5_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
12
+ date: 2013-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: newrelic_plugin
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.2.11
21
+ version: 1.0.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.2.11
29
+ version: 1.0.2
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: snmp
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -67,6 +67,7 @@ files:
67
67
  - lib/newrelic_f5_plugin.rb
68
68
  - lib/newrelic_f5_plugin/agent.rb
69
69
  - lib/newrelic_f5_plugin/nodes.rb
70
+ - lib/newrelic_f5_plugin/pools.rb
70
71
  - lib/newrelic_f5_plugin/virtuals.rb
71
72
  - newrelic_f5_plugin.gemspec
72
73
  - test/f5_monitor_test.rb