sensu-plugins-eventstore 0.0.12 → 0.0.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0e69b6da1a9133bddaac28961fa80ceff486e2d
4
- data.tar.gz: 1cea373cc00a28da343382c1e3817c83b947e9a4
3
+ metadata.gz: cb9fcbb07bb6d7c9eb9046acf22de58cadc07ce1
4
+ data.tar.gz: 2de51efa49e7d5e8d4ccc9eb8b2d79b59b5dcffb
5
5
  SHA512:
6
- metadata.gz: 7f6556254599dd9f34b0b575c5aafc6ea0b8911a282566f8a57c7f65259b29c750876d052c3f3d35df9a7112859208d8771ab24630f46a92800bbec313659f1b
7
- data.tar.gz: 17ddfc644220f4aeddf23b34c0072b32376bd2f4f52755ed854fe8a809e078d7601d2994fb58297af778500fb44b230c3cdc8a84f651941b35f9ccddc7a2f876
6
+ metadata.gz: df30944566cc2831d011e23c4123ebab032791ac64ad637aee342c4b96f48c7c64bd17bb1acbb5a3559c92c1f979fc9269a77881ada16d34575d09f349e052f9
7
+ data.tar.gz: da544bec1f5dc5a0ae7cef0be339b2c11dc2950ba0c1d9a51df03c5556ceb0688fd148f100e3978128795767136de6d3c5a4275170c99f60588e74f2e05b55fd
@@ -96,7 +96,7 @@ class Stats < Sensu::Plugin::Metric::CLI::Graphite
96
96
  def collect_metrics(address, port)
97
97
  stream_url = "http://#{address}:#{port}/streams/$stats-#{address}:#{port}"
98
98
 
99
- stream_temp_file = get_stream stream_url
99
+ stream_temp_file = get_stream stream_url, "application/atom+xml"
100
100
 
101
101
  namespace_regex = / xmlns="[A-Za-z:\/.0-9]+"/
102
102
 
@@ -113,7 +113,7 @@ class Stats < Sensu::Plugin::Metric::CLI::Graphite
113
113
 
114
114
  latest_event_url = latest_entry.at_xpath('.//id').content
115
115
 
116
- element_temp_file = get_stream latest_event_url
116
+ element_temp_file = get_stream latest_event_url, "application/json"
117
117
  json_stats = JSON.parse element_temp_file.read
118
118
 
119
119
  stats_dict = parse_json_stats json_stats
@@ -123,7 +123,7 @@ class Stats < Sensu::Plugin::Metric::CLI::Graphite
123
123
  ok
124
124
  end
125
125
 
126
- def get_stream(stream_url)
126
+ def get_stream(stream_url, accept_type)
127
127
  puts "opening stream @ url #{stream_url}"
128
128
 
129
129
  use_auth = config[:use_authentication]
@@ -133,7 +133,7 @@ class Stats < Sensu::Plugin::Metric::CLI::Graphite
133
133
  password = config[:auth_password]
134
134
  return open stream_url, http_basic_authentication:[username, password], "Accept" => "application/atom+xml"
135
135
  else
136
- return open stream_url, "Accept" => "application/atom+xml"
136
+ return open stream_url, "Accept" => accept_type
137
137
  end
138
138
  end
139
139
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-eventstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Wroe