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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 52f43d76ffd0252d9f680dd1ba73b8b1491c23d1
4
- data.tar.gz: 8ac30158218fdb7717c7d226990c56624491a36a
3
+ metadata.gz: '09a644a5f5064ea4a5f0df01df088574a9dc26d7'
4
+ data.tar.gz: 4ceead5e9d639e33cb7390b37d054280758c2312
5
5
  SHA512:
6
- metadata.gz: 4958f3703e1153e9aa83b725c6ab6fcd3338105b6231b3b469376690358bb9fe11810f86a01ed8ee129f44f80fe015ffba9ab53651797ec069f8f5759bdf9f9f
7
- data.tar.gz: 3f88891c25416e04d5a3bf1f86044d245c384e6272d2b10a6975bfa129fde0fbbb782e879774482ab54c7b03098e208264d07073323b57bc8a6334bc40d53736
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.5
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: []