kurchatov 0.2.6 → 0.2.7

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: d00f378bcedf66042d543be5fc56ad589d53cf91
4
- data.tar.gz: a5b23e869340f0c9b7f115148642a91ab2859fc1
3
+ metadata.gz: 5bf9d4c9449771ea3dbdcdf8da52590ef6a237d2
4
+ data.tar.gz: e4a9d1e5ab830158ac8e4a5f8b89b75b823e6566
5
5
  SHA512:
6
- metadata.gz: 97ec96766bc0358855f4e4f8ad9dda22cfc7b2b4a3b23bc0ec92fa038b28db04653780fcfd9d4854f08bc7407894b2fe724668e38aa41dab996bdf3a9538c50c
7
- data.tar.gz: 83986822261d6256ccfa65e3bb3a8df9d36bf2157a39104cc7330eed1d5bea6c916586ec94cc8843710b8f8b2f40820d7fc96f837711ba043ee420df32235455
6
+ metadata.gz: d45bb97b8ae40e670bb135ae6f5ad766087e6cf149e4dc07a9046e01c3642dbfbbb03375a17adab0700ee1ef7a5b69b0843a4463948d76ea1748a410eef2954b
7
+ data.tar.gz: d624df333b80e086bfdec431f0b0854840d8922bb7803e0e494647ae6a58ef4cb973fcf3d91817650ffb66ad3f2f56c59e8a1a4e77079a1969b93490d493e7b5
data/CHANGELOG CHANGED
@@ -7,3 +7,4 @@
7
7
  * Version 0.0.7: add FreeBSD support, responders as plugins
8
8
  * Version 0.2.1: count avg metric
9
9
  * Version 0.2.3: ignore_errors as count errors
10
+ * Version 0.2.7: OpenTSDB support
data/app/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "kurchatov", "= 0.2.5"
3
+ gem "kurchatov", "= 0.2.6"
4
4
  gem "sys-filesystem"
5
5
  gem "sys-proctable"
6
6
  gem "net-ping"
data/app/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GEM
11
11
  file-tail (1.0.12)
12
12
  tins (~> 0.5)
13
13
  ipaddress (0.8.0)
14
- kurchatov (0.2.5)
14
+ kurchatov (0.2.6)
15
15
  beefcake (>= 0.3.5)
16
16
  ohai (~> 6.20.0)
17
17
  mixlib-cli (1.5.0)
@@ -44,7 +44,7 @@ DEPENDENCIES
44
44
  addressable
45
45
  ffi-rzmq
46
46
  file-tail
47
- kurchatov (= 0.2.5)
47
+ kurchatov (= 0.2.6)
48
48
  net-ntp
49
49
  net-ping
50
50
  parallel
data/debian/changelog CHANGED
@@ -1,3 +1,15 @@
1
+ riemann-client (1:0.2.7) stable; urgency=low
2
+
3
+ * TSDB support
4
+
5
+ -- Undev DevOps Team <devops@undev.ru> Wed, 20 Aug 2014 10:08:20 +0000
6
+
7
+ riemann-client (1:0.2.6) stable; urgency=low
8
+
9
+ * Timeout fixes
10
+
11
+ -- Undev DevOps Team <devops@undev.ru> Fri, 14 Jul 2014 11:36:28 +0400
12
+
1
13
  riemann-client (1:0.2.5.2) stable; urgency=low
2
14
 
3
15
  * Add parallel gem
data/examples/la.rb CHANGED
@@ -1,25 +1,17 @@
1
1
  always_start true
2
2
  interval 60
3
3
 
4
- default[:cpu] = ohai[:cpu][:real]
4
+ default[:cpu] = 1
5
+ default[:cpu] = ohai[:cpu][:total] unless ohai[:cpu][:total].to_i == 0
5
6
 
6
- collect :os => 'linux' do
7
+ collect :os => "linux" do
7
8
  event(
8
- :metric => File.read('/proc/loadavg').scan(/[\d\.]+/)[0].to_f,
9
- :desc => 'LA averaged over 1 minute',
10
- :service => 'la la_1',
11
- :warning => plugin.cpu,
12
- :critical => plugin.cpu * 2
13
- )
14
- end
15
-
16
- collect :os => 'darwin' do
17
- interval = 2
18
- event(
19
- :metric => shell('uptime | cut -d":" -f4- | sed s/,//g').to_f,
20
- :desc => 'LA averaged over 1 minute',
21
- :service => 'la la_1',
22
- :warning => plugin.cpu,
23
- :critical => plugin.cpu * 2
9
+ :metric => File.read('/proc/loadavg').scan(/[\d\.]+/)[0].to_f,
10
+ :desc => 'LA averaged over 1 minute',
11
+ :service => 'la la_1',
12
+ :warning => plugin.warning || plugin.cpu * 2,
13
+ :critical => plugin.critical || plugin.cpu * 4,
14
+ :tsdb_service => "sys.la.one_min",
15
+ :tsdb_tags => {"host" => ohai[:fqdn]}
24
16
  )
25
17
  end
@@ -6,7 +6,8 @@ module Kurchatov
6
6
 
7
7
  EVENT_FIELDS = [
8
8
  :time, :state, :service, :host,
9
- :description, :tags, :ttl, :metric
9
+ :description, :tags, :ttl, :metric,
10
+ :tsdb_service, :tsdb_tags
10
11
  ]
11
12
 
12
13
  def event(hash = {})
@@ -32,6 +33,7 @@ module Kurchatov
32
33
  set_bool_state(hash)
33
34
  set_avg_metric(hash)
34
35
  set_event_state(hash)
36
+ set_tsdb_tags(hash)
35
37
 
36
38
  return false if hash[:miss]
37
39
 
@@ -103,6 +105,13 @@ module Kurchatov
103
105
 
104
106
  end
105
107
 
108
+ def set_tsdb_tags(hash = {})
109
+ hash[:tsdb_tags] ||= {}
110
+ hash[:tsdb_tags] = hash[:tsdb_tags].map {|k,v| "#{k}=#{v}" }
111
+ hash[:tsdb_tags] << "host=#{Kurchatov::Config[:host]}"
112
+ hash[:tsdb_tags].uniq!
113
+ end
114
+
106
115
  end
107
116
  end
108
117
  end
@@ -12,6 +12,8 @@ module Kurchatov
12
12
  optional :metric_sint64, :sint64, 13
13
13
  optional :metric_d, :double, 14
14
14
  optional :metric_f, :float, 15
15
+ optional :tsdb_service, :string, 16
16
+ repeated :tsdb_tags, :string, 17
15
17
 
16
18
  def initialize(hash = nil)
17
19
  if hash
@@ -1,3 +1,3 @@
1
1
  module Kurchatov
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kurchatov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasiliev Dmitry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-14 00:00:00.000000000 Z
11
+ date: 2014-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: beefcake