newrelic_f5_plugin 1.0.12 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGES +14 -0
- data/README.rdoc +15 -0
- data/lib/newrelic_f5_plugin/agent.rb +16 -188
- data/lib/newrelic_f5_plugin/client_ssl.rb +42 -0
- data/lib/newrelic_f5_plugin/device.rb +136 -3
- data/lib/newrelic_f5_plugin/nodes.rb +14 -1
- data/lib/newrelic_f5_plugin/pools.rb +147 -38
- data/lib/newrelic_f5_plugin/rules.rb +40 -18
- data/lib/newrelic_f5_plugin/snatpools.rb +32 -0
- data/lib/newrelic_f5_plugin/virtuals.rb +169 -53
- data/newrelic_f5_plugin.gemspec +5 -4
- metadata +29 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f4de3101ffe13d4eeb48b77722e6d0ede0d22ad6
|
4
|
+
data.tar.gz: 209080c82f5e16c92bacb4d35c204404d02865cb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5796767f4c3461ff54ac392c3e6efde4d744fadf5d3b7f2743ce50345221d49cb40261309d7d10efce038a73e9f98197a346b3fa63c3c3119f13f81ad6daa6f1
|
7
|
+
data.tar.gz: 96db6ecf6410ae9a21a6bccfafb007cd44b6dc22e4e65cf0d9ec3b996d059147a76b9402b4ddd2b7b350e4845aa7b1663c386f532f8ec54673ceb2e6da0a8322
|
data/CHANGES
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
* 1.0.15
|
2
|
+
- Fix bug in 1.0.14 where pool data collection was multiplied by 8 twice
|
3
|
+
|
4
|
+
* 1.0.14
|
5
|
+
- Refactored the agent code so each module is more self contained
|
6
|
+
- Limit data reported for Virtuals and Pools to the top 150
|
7
|
+
|
8
|
+
* 1.0.13
|
9
|
+
- Added more global TCP statistics:
|
10
|
+
- Received error rates: Bad Checksums, and Resets
|
11
|
+
- Segments: Retransmitted, RX Out of Order, and RX Malformed
|
12
|
+
- SYN-Cookies: Received, Bad, and Cache overflows
|
13
|
+
- Connections Failed, Expired, and Abandoned
|
14
|
+
|
1
15
|
* 1.0.12
|
2
16
|
- Added Virtual Servers and Pools statistics:
|
3
17
|
- Inbound Packets per second
|
data/README.rdoc
CHANGED
@@ -68,6 +68,17 @@ SNMP version 2c is supported.
|
|
68
68
|
|
69
69
|
f5_monitor run
|
70
70
|
|
71
|
+
== Additional Configuration
|
72
|
+
|
73
|
+
To configure proxy settings, add to the newrelic_plugin.yml file:
|
74
|
+
|
75
|
+
newrelic:
|
76
|
+
proxy:
|
77
|
+
address: PROXY_ADDRESS
|
78
|
+
port: PROXY_PORT
|
79
|
+
user: PROXY_USER
|
80
|
+
password: PROXY_PASSWORD
|
81
|
+
|
71
82
|
== Installation with Chef/Puppet
|
72
83
|
|
73
84
|
The F5 plugin can also be installed with {Chef}[http://www.getchef.com] and {Puppet}[http://puppetlabs.com]. For Chef and Puppet support see the New Relic plugin's {Chef Cookbook}[http://community.opscode.com/cookbooks/newrelic_plugins] and {Puppet Module}[https://forge.puppetlabs.com/newrelic/newrelic_plugins].
|
@@ -83,3 +94,7 @@ Additional information on using Chef and Puppet with New Relic is available in N
|
|
83
94
|
|
84
95
|
3. Run <b><tt>rake -T</tt></b> to see rake options, including tests.
|
85
96
|
|
97
|
+
|
98
|
+
== Contributing
|
99
|
+
|
100
|
+
You are welcome to send pull requests to us - however, by doing so you agree that you are granting New Relic a non-exclusive, non-revokable, no-cost license to use the code, algorithms, patents, and ideas in that code in our products if we so choose. You also agree the code is provided as-is and you provide no warranties as to its fitness or correctness for any purpose.
|
@@ -4,7 +4,7 @@ require 'newrelic_plugin'
|
|
4
4
|
require 'snmp'
|
5
5
|
|
6
6
|
module NewRelic::F5Plugin
|
7
|
-
VERSION = '1.0.
|
7
|
+
VERSION = '1.0.15'
|
8
8
|
|
9
9
|
# Register and run the agent
|
10
10
|
def self.run
|
@@ -72,214 +72,42 @@ module NewRelic::F5Plugin
|
|
72
72
|
end
|
73
73
|
|
74
74
|
|
75
|
-
#
|
76
75
|
# Device wide metrics
|
77
|
-
|
78
|
-
system
|
79
|
-
|
80
|
-
system_version = system.get_version
|
81
|
-
NewRelic::PlatformLogger.debug("Found F5 device with version: #{system_version}")
|
82
|
-
|
83
|
-
system_cpu = system.get_cpu
|
84
|
-
system_cpu.each_key { |m| report_metric m, "%", system_cpu[m] } unless system_cpu.nil?
|
85
|
-
|
86
|
-
system_memory = system.get_memory
|
87
|
-
system_memory.each_key { |m| report_metric m, "bytes", system_memory[m] } unless system_memory.nil?
|
88
|
-
|
89
|
-
system_connections = system.get_connections
|
90
|
-
system_connections.each_key { |m| report_metric m, "conn", system_connections[m] } unless system_connections.nil?
|
91
|
-
|
92
|
-
system_connection_rates = system.get_connection_rates
|
93
|
-
system_connection_rates.each_key { |m| report_counter_metric m, "conn/sec", system_connection_rates[m] } unless system_connection_rates.nil?
|
94
|
-
|
95
|
-
system_throughput = system.get_throughput
|
96
|
-
system_throughput.each_key { |m| report_counter_metric m, "bits/sec", system_throughput[m] } unless system_throughput.nil?
|
97
|
-
|
98
|
-
system_http_reqs = system.get_http_requests
|
99
|
-
system_http_reqs.each_key { |m| report_counter_metric m, "req/sec", system_http_reqs[m] } unless system_http_reqs.nil?
|
76
|
+
NewRelic::PlatformLogger.debug("Collecting System stats")
|
77
|
+
@system ||= NewRelic::F5Plugin::Device.new
|
78
|
+
@system.poll(self, snmp)
|
100
79
|
|
101
|
-
system_http_resp = system.get_http_responses
|
102
|
-
system_http_resp.each_key { |m| report_counter_metric m, "resp/sec", system_http_resp[m] } unless system_http_resp.nil?
|
103
|
-
|
104
|
-
system_http_compression = system.get_http_compression
|
105
|
-
system_http_compression.each_key { |m| report_counter_metric m, "bits/sec", system_http_compression[m] } unless system_http_compression.nil?
|
106
|
-
|
107
|
-
system_ssl = system.get_ssl
|
108
|
-
system_ssl.each_key { |m| report_counter_metric m, "trans/sec", system_ssl[m] } unless system_ssl.nil?
|
109
|
-
|
110
|
-
system_tcp_conns = system.get_tcp_connections
|
111
|
-
system_tcp_conns.each_key { |m| report_metric m, "conn", system_tcp_conns[m] } unless system_tcp_conns.nil?
|
112
|
-
|
113
|
-
system_tcp_conn_rates = system.get_tcp_connection_rates
|
114
|
-
system_tcp_conn_rates.each_key { |m| report_counter_metric m, "conn/sec", system_tcp_conn_rates[m] } unless system_tcp_conn_rates.nil?
|
115
|
-
|
116
|
-
#
|
117
80
|
# Node stats
|
118
|
-
#
|
119
81
|
NewRelic::PlatformLogger.debug("Collecting Node stats")
|
120
|
-
nodes
|
121
|
-
|
122
|
-
node_status.each_key { |m| report_metric m, node_status[m][:label], node_status[m][:count] } unless node_status.nil?
|
82
|
+
@nodes ||= NewRelic::F5Plugin::Nodes.new
|
83
|
+
@nodes.poll(self, snmp)
|
123
84
|
|
124
|
-
#
|
125
85
|
# Collect virtual server statistics
|
126
|
-
#
|
127
86
|
NewRelic::PlatformLogger.debug("Collecting Virtual Server stats")
|
128
|
-
|
87
|
+
@virtuals ||= NewRelic::F5Plugin::Virtuals.new
|
88
|
+
@virtuals.poll(self, snmp)
|
129
89
|
|
130
|
-
unless vs.get_names.empty?
|
131
|
-
virtual_requests = vs.get_requests
|
132
|
-
virtual_requests.each_key { |m| report_counter_metric m, "req/sec", virtual_requests[m] } unless virtual_requests.nil?
|
133
|
-
|
134
|
-
virtual_conns_current = vs.get_conns_current
|
135
|
-
virtual_conns_current.each_key { |m| report_metric m, "conns", virtual_conns_current[m] } unless virtual_conns_current.nil?
|
136
|
-
|
137
|
-
virtual_conns_total = vs.get_conns_total
|
138
|
-
virtual_conns_total.each_key { |m| report_counter_metric m, "conn/sec", virtual_conns_total[m] } unless virtual_conns_total.nil?
|
139
|
-
|
140
|
-
virtual_packets_in = vs.get_packets_in
|
141
|
-
virtual_packets_in.each_key { |m| report_counter_metric m, "packets/sec", virtual_packets_in[m] } unless virtual_packets_in.nil?
|
142
|
-
|
143
|
-
virtual_packets_out = vs.get_packets_out
|
144
|
-
virtual_packets_out.each_key { |m| report_counter_metric m, "packets/sec", virtual_packets_out[m] } unless virtual_packets_out.nil?
|
145
|
-
|
146
|
-
virtual_throughput_in = vs.get_throughput_in
|
147
|
-
virtual_throughput_in.each_key { |m| report_counter_metric m, "bits/sec", virtual_throughput_in[m] } unless virtual_throughput_in.nil?
|
148
|
-
|
149
|
-
virtual_throughput_out = vs.get_throughput_out
|
150
|
-
virtual_throughput_out.each_key { |m| report_counter_metric m, "bits/sec", virtual_throughput_out[m] } unless virtual_throughput_out.nil?
|
151
|
-
|
152
|
-
virtual_cpu_usage_1m = vs.get_cpu_usage_1m
|
153
|
-
virtual_cpu_usage_1m.each_key { |m| report_metric m, "%", virtual_cpu_usage_1m[m] } unless virtual_cpu_usage_1m.nil?
|
154
|
-
end
|
155
|
-
|
156
|
-
#
|
157
90
|
# Collect pool statistics
|
158
|
-
#
|
159
91
|
NewRelic::PlatformLogger.debug("Collecting Pool stats")
|
160
|
-
|
161
|
-
|
162
|
-
unless pool.get_names.empty?
|
163
|
-
pool_requests = pool.get_requests
|
164
|
-
pool_requests.each_key { |m| report_counter_metric m, "req/sec", pool_requests[m] } unless pool_requests.nil?
|
165
|
-
|
166
|
-
pool_conns_current = pool.get_conns_current
|
167
|
-
pool_conns_current.each_key { |m| report_metric m, "conns", pool_conns_current[m] } unless pool_conns_current.nil?
|
168
|
-
|
169
|
-
pool_conns_total = pool.get_conns_total
|
170
|
-
pool_conns_total.each_key { |m| report_counter_metric m, "conn/sec", pool_conns_total[m] } unless pool_conns_total.nil?
|
171
|
-
|
172
|
-
pool_packets_in = pool.get_packets_in
|
173
|
-
pool_packets_in.each_key { |m| report_counter_metric m, "packets/sec", pool_packets_in[m] } unless pool_packets_in.nil?
|
174
|
-
|
175
|
-
pool_packets_out = pool.get_packets_out
|
176
|
-
pool_packets_out.each_key { |m| report_counter_metric m, "packets/sec", pool_packets_out[m] } unless pool_packets_out.nil?
|
177
|
-
|
178
|
-
pool_throughput_in = pool.get_throughput_in
|
179
|
-
pool_throughput_in.each_key { |m| report_counter_metric m, "bits/sec", pool_throughput_in[m] } unless pool_throughput_in.nil?
|
92
|
+
@pools ||= NewRelic::F5Plugin::Pools.new
|
93
|
+
@pools.poll(self, snmp)
|
180
94
|
|
181
|
-
pool_throughput_out = pool.get_throughput_out
|
182
|
-
pool_throughput_out.each_key { |m| report_counter_metric m, "bits/sec", pool_throughput_out[m] } unless pool_throughput_out.nil?
|
183
|
-
end
|
184
|
-
|
185
|
-
|
186
|
-
#
|
187
95
|
# iRule statistics
|
188
|
-
#
|
189
96
|
NewRelic::PlatformLogger.debug("Collecting iRule stats")
|
190
|
-
|
191
|
-
|
192
|
-
unless rule.get_names.empty?
|
193
|
-
rule_execs = rule.get_executions
|
194
|
-
rule_execs.each_key { |m| report_counter_metric m, "execs/sec", rule_execs[m] } unless rule_execs.nil?
|
195
|
-
|
196
|
-
rule_failures = rule.get_failures
|
197
|
-
rule_failures.each_key { |m| report_counter_metric m, "failures/sec", rule_failures[m] } unless rule_failures.nil?
|
198
|
-
|
199
|
-
rule_aborts = rule.get_aborts
|
200
|
-
rule_aborts.each_key { |m| report_counter_metric m, "aborts/sec", rule_aborts[m] } unless rule_aborts.nil?
|
201
|
-
|
202
|
-
rule_cycles = rule.get_average_cycles
|
203
|
-
rule_cycles.each_key { |m| report_metric m, "cycles", rule_cycles[m] } unless rule_cycles.nil?
|
204
|
-
end
|
205
|
-
|
97
|
+
@rules ||= NewRelic::F5Plugin::Rules.new
|
98
|
+
@rules.poll(self, snmp)
|
206
99
|
|
207
|
-
#
|
208
100
|
# Collect snat pool statistics
|
209
|
-
#
|
210
101
|
NewRelic::PlatformLogger.debug("Collecting SNAT Pool stats")
|
211
|
-
|
212
|
-
|
213
|
-
unless snatpool.get_names.empty?
|
214
|
-
snatpool_conns_max = snatpool.get_conns_max
|
215
|
-
snatpool_conns_max.each_key { |m| report_metric m, "conns", snatpool_conns_max[m] } unless snatpool_conns_max.nil?
|
216
|
-
|
217
|
-
snatpool_conns_current = snatpool.get_conns_current
|
218
|
-
snatpool_conns_current.each_key { |m| report_metric m, "conns", snatpool_conns_current[m] } unless snatpool_conns_current.nil?
|
219
|
-
|
220
|
-
snatpool_conns_total = snatpool.get_conns_total
|
221
|
-
snatpool_conns_total.each_key { |m| report_counter_metric m, "conn/sec", snatpool_conns_total[m] } unless snatpool_conns_total.nil?
|
222
|
-
|
223
|
-
snatpool_throughput_in = snatpool.get_throughput_in
|
224
|
-
snatpool_throughput_in.each_key { |m| report_counter_metric m, "bits/sec", snatpool_throughput_in[m] } unless snatpool_throughput_in.nil?
|
225
|
-
|
226
|
-
snatpool_throughput_out = snatpool.get_throughput_out
|
227
|
-
snatpool_throughput_out.each_key { |m| report_counter_metric m, "bits/sec", snatpool_throughput_out[m] } unless snatpool_throughput_out.nil?
|
102
|
+
@snatpools ||= NewRelic::F5Plugin::SnatPools.new
|
103
|
+
@snatpools.poll(self, snmp)
|
228
104
|
|
229
|
-
snatpool_packets_in = snatpool.get_packets_in
|
230
|
-
snatpool_packets_in.each_key { |m| report_counter_metric m, "pkts/sec", snatpool_packets_in[m] } unless snatpool_packets_in.nil?
|
231
|
-
|
232
|
-
snatpool_packets_out = snatpool.get_packets_out
|
233
|
-
snatpool_packets_out.each_key { |m| report_counter_metric m, "pkts/sec", snatpool_packets_out[m] } unless snatpool_packets_out.nil?
|
234
|
-
end
|
235
|
-
|
236
|
-
|
237
|
-
#
|
238
105
|
# Collect Client SSL Profile statistics
|
239
|
-
#
|
240
106
|
NewRelic::PlatformLogger.debug("Collecting Client SSL Profile stats")
|
241
|
-
clientssl
|
242
|
-
|
243
|
-
unless clientssl.get_names.empty?
|
244
|
-
clientssl_conns_current = clientssl.get_conns_current
|
245
|
-
clientssl_conns_current.each_key { |m| report_metric m, "conns", clientssl_conns_current[m] } unless clientssl_conns_current.nil?
|
246
|
-
|
247
|
-
clientssl_session_cache_current = clientssl.get_session_cache_current
|
248
|
-
clientssl_session_cache_current.each_key { |m| report_metric m, "entries", clientssl_session_cache_current[m] } unless clientssl_session_cache_current.nil?
|
249
|
-
|
250
|
-
clientssl_session_cache_hits = clientssl.get_session_cache_hits
|
251
|
-
clientssl_session_cache_hits.each_key { |m| report_counter_metric m, "hits/sec", clientssl_session_cache_hits[m] } unless clientssl_session_cache_hits.nil?
|
107
|
+
@clientssl ||= NewRelic::F5Plugin::ClientSsl.new
|
108
|
+
@clientssl.poll(self, snmp)
|
252
109
|
|
253
|
-
clientssl_session_cache_lookups = clientssl.get_session_cache_lookups
|
254
|
-
clientssl_session_cache_lookups.each_key { |m| report_counter_metric m, "lookups/sec", clientssl_session_cache_lookups[m] } unless clientssl_session_cache_lookups.nil?
|
255
|
-
|
256
|
-
NewRelic::PlatformLogger.debug("Calculating Client SSL Profile hit ratios")
|
257
|
-
clientssl_hit_ratio = { }
|
258
|
-
clientssl_session_cache_hits.each_key do |h|
|
259
|
-
key = h.gsub(/^Client SSL Profiles\/Session Cache Hits\//, '')
|
260
|
-
l = "Client SSL Profiles/Session Cache Lookups/#{key}"
|
261
|
-
p = "Client SSL Profiles/Session Cache Hit Ratio/#{key}"
|
262
|
-
unless clientssl_session_cache_lookups[l].nil?
|
263
|
-
if clientssl_session_cache_lookups[l].to_f > 0
|
264
|
-
clientssl_hit_ratio[p] = (clientssl_session_cache_hits[h].to_f / clientssl_session_cache_lookups[l].to_f) * 100
|
265
|
-
else
|
266
|
-
clientssl_hit_ratio[p] = 0.0
|
267
|
-
end
|
268
|
-
end
|
269
|
-
end
|
270
|
-
clientssl_hit_ratio.each_key { |m| report_metric m, "%", clientssl_hit_ratio[m] } unless clientssl_hit_ratio.empty?
|
271
|
-
|
272
|
-
clientssl_session_cache_overflows = clientssl.get_session_cache_overflows
|
273
|
-
clientssl_session_cache_overflows.each_key { |m| report_counter_metric m, "overflows/sec", clientssl_session_cache_overflows[m] } unless clientssl_session_cache_overflows.nil?
|
274
|
-
|
275
|
-
clientssl_session_cache_invalidations = clientssl.get_session_cache_invalidations
|
276
|
-
clientssl_session_cache_invalidations.each_key { |m| report_counter_metric m, "invld/sec", clientssl_session_cache_invalidations[m] } unless clientssl_session_cache_invalidations.nil?
|
277
|
-
end
|
278
|
-
|
279
|
-
|
280
|
-
#
|
281
110
|
# Cleanup snmp connection
|
282
|
-
#
|
283
111
|
snmp.close
|
284
112
|
end
|
285
113
|
|
@@ -105,6 +105,48 @@ module NewRelic
|
|
105
105
|
end
|
106
106
|
|
107
107
|
|
108
|
+
#
|
109
|
+
# Perform polling and reportings of metrics
|
110
|
+
#
|
111
|
+
def poll(agent, snmp)
|
112
|
+
@snmp_manager = snmp
|
113
|
+
|
114
|
+
unless get_names.empty?
|
115
|
+
clientssl_conns_current = get_conns_current
|
116
|
+
clientssl_conns_current.each_key { |m| agent.report_metric m, "conns", clientssl_conns_current[m] } unless clientssl_conns_current.nil?
|
117
|
+
|
118
|
+
clientssl_session_cache_current = get_session_cache_current
|
119
|
+
clientssl_session_cache_current.each_key { |m| agent.report_metric m, "entries", clientssl_session_cache_current[m] } unless clientssl_session_cache_current.nil?
|
120
|
+
|
121
|
+
clientssl_session_cache_hits = get_session_cache_hits
|
122
|
+
clientssl_session_cache_hits.each_key { |m| agent.report_counter_metric m, "hits/sec", clientssl_session_cache_hits[m] } unless clientssl_session_cache_hits.nil?
|
123
|
+
|
124
|
+
clientssl_session_cache_lookups = get_session_cache_lookups
|
125
|
+
clientssl_session_cache_lookups.each_key { |m| agent.report_counter_metric m, "lookups/sec", clientssl_session_cache_lookups[m] } unless clientssl_session_cache_lookups.nil?
|
126
|
+
|
127
|
+
NewRelic::PlatformLogger.debug("Calculating Client SSL Profile hit ratios")
|
128
|
+
clientssl_hit_ratio = { }
|
129
|
+
clientssl_session_cache_hits.each_key do |h|
|
130
|
+
key = h.gsub(/^Client SSL Profiles\/Session Cache Hits\//, '')
|
131
|
+
l = "Client SSL Profiles/Session Cache Lookups/#{key}"
|
132
|
+
p = "Client SSL Profiles/Session Cache Hit Ratio/#{key}"
|
133
|
+
unless clientssl_session_cache_lookups[l].nil?
|
134
|
+
if clientssl_session_cache_lookups[l].to_f > 0
|
135
|
+
clientssl_hit_ratio[p] = (clientssl_session_cache_hits[h].to_f / clientssl_session_cache_lookups[l].to_f) * 100
|
136
|
+
else
|
137
|
+
clientssl_hit_ratio[p] = 0.0
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
clientssl_hit_ratio.each_key { |m| agent.report_metric m, "%", clientssl_hit_ratio[m] } unless clientssl_hit_ratio.empty?
|
142
|
+
|
143
|
+
clientssl_session_cache_overflows = get_session_cache_overflows
|
144
|
+
clientssl_session_cache_overflows.each_key { |m| agent.report_counter_metric m, "overflows/sec", clientssl_session_cache_overflows[m] } unless clientssl_session_cache_overflows.nil?
|
145
|
+
|
146
|
+
clientssl_session_cache_invalidations = get_session_cache_invalidations
|
147
|
+
clientssl_session_cache_invalidations.each_key { |m| agent.report_counter_metric m, "invld/sec", clientssl_session_cache_invalidations[m] } unless clientssl_session_cache_invalidations.nil?
|
148
|
+
end
|
149
|
+
end
|
108
150
|
|
109
151
|
#
|
110
152
|
# Get the list of iRule names
|
@@ -7,7 +7,7 @@ module NewRelic
|
|
7
7
|
module F5Plugin
|
8
8
|
|
9
9
|
class Device
|
10
|
-
attr_accessor :
|
10
|
+
attr_accessor :snmp_manager
|
11
11
|
|
12
12
|
# Create the OIDs if they do not exist
|
13
13
|
OID_SYS_CLIENTSSL_STAT_CUR_CONNS = "1.3.6.1.4.1.3375.2.1.1.2.9.2.0"
|
@@ -118,6 +118,62 @@ module NewRelic
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
+
|
122
|
+
|
123
|
+
#
|
124
|
+
# Perform polling and reportings of metrics
|
125
|
+
#
|
126
|
+
def poll(agent, snmp)
|
127
|
+
@snmp_manager = snmp
|
128
|
+
|
129
|
+
system_version = get_version
|
130
|
+
NewRelic::PlatformLogger.debug("Found F5 device with version: #{system_version}")
|
131
|
+
|
132
|
+
system_cpu = get_cpu
|
133
|
+
system_cpu.each_key { |m| agent.report_metric m, "%", system_cpu[m] } unless system_cpu.nil?
|
134
|
+
|
135
|
+
system_memory = get_memory
|
136
|
+
system_memory.each_key { |m| agent.report_metric m, "bytes", system_memory[m] } unless system_memory.nil?
|
137
|
+
|
138
|
+
system_connections = get_connections
|
139
|
+
system_connections.each_key { |m| agent.report_metric m, "conn", system_connections[m] } unless system_connections.nil?
|
140
|
+
|
141
|
+
system_connection_rates = get_connection_rates
|
142
|
+
system_connection_rates.each_key { |m| agent.report_counter_metric m, "conn/sec", system_connection_rates[m] } unless system_connection_rates.nil?
|
143
|
+
|
144
|
+
system_throughput = get_throughput
|
145
|
+
system_throughput.each_key { |m| agent.report_counter_metric m, "bits/sec", system_throughput[m] } unless system_throughput.nil?
|
146
|
+
|
147
|
+
system_http_reqs = get_http_requests
|
148
|
+
system_http_reqs.each_key { |m| agent.report_counter_metric m, "req/sec", system_http_reqs[m] } unless system_http_reqs.nil?
|
149
|
+
|
150
|
+
system_http_resp = get_http_responses
|
151
|
+
system_http_resp.each_key { |m| agent.report_counter_metric m, "resp/sec", system_http_resp[m] } unless system_http_resp.nil?
|
152
|
+
|
153
|
+
system_http_compression = get_http_compression
|
154
|
+
system_http_compression.each_key { |m| agent.report_counter_metric m, "bits/sec", system_http_compression[m] } unless system_http_compression.nil?
|
155
|
+
|
156
|
+
system_ssl = get_ssl
|
157
|
+
system_ssl.each_key { |m| agent.report_counter_metric m, "trans/sec", system_ssl[m] } unless system_ssl.nil?
|
158
|
+
|
159
|
+
system_tcp_conns = get_tcp_connections
|
160
|
+
system_tcp_conns.each_key { |m| agent.report_metric m, "conn", system_tcp_conns[m] } unless system_tcp_conns.nil?
|
161
|
+
|
162
|
+
system_tcp_conn_rates = get_tcp_connection_rates
|
163
|
+
system_tcp_conn_rates.each_key { |m| agent.report_counter_metric m, "conn/sec", system_tcp_conn_rates[m] } unless system_tcp_conn_rates.nil?
|
164
|
+
|
165
|
+
system_tcp_syn_rates = get_tcp_syn_rates
|
166
|
+
system_tcp_syn_rates.each_key { |m| agent.report_counter_metric m, "SYN/sec", system_tcp_syn_rates[m] } unless system_tcp_syn_rates.nil?
|
167
|
+
|
168
|
+
system_tcp_segment_rates = get_tcp_segment_rates
|
169
|
+
system_tcp_segment_rates.each_key { |m| agent.report_counter_metric m, "segments/sec", system_tcp_segment_rates[m] } unless system_tcp_segment_rates.nil?
|
170
|
+
|
171
|
+
system_tcp_error_rates = get_tcp_error_rates
|
172
|
+
system_tcp_error_rates.each_key { |m| agent.report_counter_metric m, "errs/sec", system_tcp_error_rates[m] } unless system_tcp_error_rates.nil?
|
173
|
+
end
|
174
|
+
|
175
|
+
|
176
|
+
|
121
177
|
#
|
122
178
|
# Gather Version information
|
123
179
|
#
|
@@ -440,6 +496,75 @@ module NewRelic
|
|
440
496
|
end
|
441
497
|
|
442
498
|
|
499
|
+
#
|
500
|
+
# Gather TCP Segment statistics
|
501
|
+
#
|
502
|
+
def get_tcp_segment_rates(snmp = nil)
|
503
|
+
metrics = { }
|
504
|
+
snmp = snmp_manager unless snmp
|
505
|
+
|
506
|
+
if snmp
|
507
|
+
res = gather_snmp_metrics_array([OID_SYS_TCP_STAT_RXBADSEG, OID_SYS_TCP_STAT_RXOOSEG,
|
508
|
+
OID_SYS_TCP_STAT_TXREXMITS],
|
509
|
+
snmp)
|
510
|
+
|
511
|
+
# Bail out if we didn't get anything
|
512
|
+
return metrics if res.empty?
|
513
|
+
|
514
|
+
metrics["TCP/Segments/Received Malformed"] = res[0]
|
515
|
+
metrics["TCP/Segments/Received Out of Order"] = res[1]
|
516
|
+
metrics["TCP/Segments/Retransmitted"] = res[2]
|
517
|
+
end
|
518
|
+
|
519
|
+
return metrics
|
520
|
+
end
|
521
|
+
|
522
|
+
|
523
|
+
#
|
524
|
+
# Gather TCP Error statistics
|
525
|
+
#
|
526
|
+
def get_tcp_error_rates(snmp = nil)
|
527
|
+
metrics = { }
|
528
|
+
snmp = snmp_manager unless snmp
|
529
|
+
|
530
|
+
if snmp
|
531
|
+
res = gather_snmp_metrics_array([OID_SYS_TCP_STAT_RXRST, OID_SYS_TCP_STAT_RXBADSUM], snmp)
|
532
|
+
|
533
|
+
# Bail out if we didn't get anything
|
534
|
+
return metrics if res.empty?
|
535
|
+
|
536
|
+
metrics["TCP/Errors/Received/Resets"] = res[0]
|
537
|
+
metrics["TCP/Errors/Received/Bad Checksums"] = res[1]
|
538
|
+
end
|
539
|
+
|
540
|
+
return metrics
|
541
|
+
end
|
542
|
+
|
543
|
+
|
544
|
+
#
|
545
|
+
# Gather TCP Syn statistics
|
546
|
+
#
|
547
|
+
def get_tcp_syn_rates(snmp = nil)
|
548
|
+
metrics = { }
|
549
|
+
snmp = snmp_manager unless snmp
|
550
|
+
|
551
|
+
if snmp
|
552
|
+
res = gather_snmp_metrics_array([OID_SYS_TCP_STAT_RXCOOKIE, OID_SYS_TCP_STAT_RXBADCOOKIE,
|
553
|
+
OID_SYS_TCP_STAT_SYNCACHEOVER],
|
554
|
+
snmp)
|
555
|
+
|
556
|
+
# Bail out if we didn't get anything
|
557
|
+
return metrics if res.empty?
|
558
|
+
|
559
|
+
metrics["TCP/SYN/Received SYN-Cookies"] = res[0]
|
560
|
+
metrics["TCP/SYN/Bad SYN-Cookies"] = res[1]
|
561
|
+
metrics["TCP/SYN/SYN-cache Overflows"] = res[2]
|
562
|
+
end
|
563
|
+
|
564
|
+
return metrics
|
565
|
+
end
|
566
|
+
|
567
|
+
|
443
568
|
#
|
444
569
|
# Gather TCP Statistics in conn/sec
|
445
570
|
#
|
@@ -448,12 +573,20 @@ module NewRelic
|
|
448
573
|
snmp = snmp_manager unless snmp
|
449
574
|
|
450
575
|
if snmp
|
451
|
-
res = gather_snmp_metrics_array([OID_SYS_TCP_STAT_ACCEPTS
|
576
|
+
res = gather_snmp_metrics_array([OID_SYS_TCP_STAT_ACCEPTS, OID_SYS_TCP_STAT_ACCEPTFAILS,
|
577
|
+
OID_SYS_TCP_STAT_CONNECTS, OID_SYS_TCP_STAT_CONNFAILS,
|
578
|
+
OID_SYS_TCP_STAT_EXPIRES, OID_SYS_TCP_STAT_ABANDONS],
|
579
|
+
snmp)
|
452
580
|
|
453
581
|
# Bail out if we didn't get anything
|
454
582
|
return metrics if res.empty?
|
455
583
|
|
456
|
-
metrics["TCP/Accepts"]
|
584
|
+
metrics["TCP/Accepts"] = res[0]
|
585
|
+
metrics["TCP/Accept Fails"] = res[1]
|
586
|
+
metrics["TCP/Connections/Established"] = res[2]
|
587
|
+
metrics["TCP/Connections/Failed"] = res[3]
|
588
|
+
metrics["TCP/Connections/Expired"] = res[4]
|
589
|
+
metrics["TCP/Connections/Abandoned"] = res[5]
|
457
590
|
end
|
458
591
|
|
459
592
|
return metrics
|