sensu-plugins-eventstore 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/metrics-eventstore-stats-stream.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb9fcbb07bb6d7c9eb9046acf22de58cadc07ce1
|
4
|
+
data.tar.gz: 2de51efa49e7d5e8d4ccc9eb8b2d79b59b5dcffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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" =>
|
136
|
+
return open stream_url, "Accept" => accept_type
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|