sumo-check-es 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sumo-metric-es_thread_pool.rb +41 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09a644a5f5064ea4a5f0df01df088574a9dc26d7'
|
4
|
+
data.tar.gz: 4ceead5e9d639e33cb7390b37d054280758c2312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2202af22c79a380202308ef0d8e921c7646282d38a5cf8337d9584da17914473e232343262a5ba05b413e04a60f6553f96d5c495bd908be5a4b1ef3fdd73ba56
|
7
|
+
data.tar.gz: '09a4b32b5d9fa2af45e45d304191652e44fa706c18124101c464e3f1b8aa334aee0512742a44f6b402731efbb04faa4cecccf162bb8300a861f93ce230acd471'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rest-client'
|
3
|
+
require 'sensu-plugin/metric/cli'
|
4
|
+
require 'uri'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
class SensuMetricEsSubscriberRate < Sensu::Plugin::Metric::CLI::Graphite
|
8
|
+
option :server,
|
9
|
+
short: '-s http://localhost:9200',
|
10
|
+
long: '--server',
|
11
|
+
description: 'Hostname of Elastic Search Cluster',
|
12
|
+
default: 'http://localhost:9200'
|
13
|
+
|
14
|
+
|
15
|
+
def run
|
16
|
+
return_data = []
|
17
|
+
# uri = URI(config[:server].strip)
|
18
|
+
response=RestClient.get "http://localhost:9200/_cat/thread_pool", {params: {format: 'json', 'pretty' => true}}
|
19
|
+
if response.code == 200
|
20
|
+
data = JSON.parse(response.body)
|
21
|
+
data.each do |i|
|
22
|
+
return_data << {"#{i["name"]}.#{i["node_name"]}.active" => i["active"].to_i}
|
23
|
+
return_data << {"#{i["name"]}.#{i["node_name"]}.queue" => i["queue"].to_i}
|
24
|
+
return_data << {"#{i["name"]}.#{i["node_name"]}.rejected" => i["rejected"].to_i}
|
25
|
+
end
|
26
|
+
timestamp = Time.now.to_i
|
27
|
+
|
28
|
+
return_data.each do |metric|
|
29
|
+
metric.each do |k,v|
|
30
|
+
output k, v, timestamp
|
31
|
+
end
|
32
|
+
end
|
33
|
+
ok
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sumo-check-es
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dr. Ogg
|
@@ -74,6 +74,7 @@ executables:
|
|
74
74
|
- sumo-check-events_rate.rb
|
75
75
|
- sumo-metric-es_subscriber_rate.rb
|
76
76
|
- sumo-metric-events_rate.rb
|
77
|
+
- sumo-metric-es_thread_pool.rb
|
77
78
|
extensions: []
|
78
79
|
extra_rdoc_files: []
|
79
80
|
files:
|
@@ -81,6 +82,7 @@ files:
|
|
81
82
|
- bin/sumo-check-es_subscriber_status.rb
|
82
83
|
- bin/sumo-check-events_rate.rb
|
83
84
|
- bin/sumo-metric-es_subscriber_rate.rb
|
85
|
+
- bin/sumo-metric-es_thread_pool.rb
|
84
86
|
- bin/sumo-metric-events_rate.rb
|
85
87
|
homepage:
|
86
88
|
licenses: []
|