htmon-icinga 0.3.4 → 0.4.0

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: 644882a8315c57b9528732957b06f72ec8cc902d
4
- data.tar.gz: 40b64a1b92d09aa2bbc4fb782bcb9cf404894bdb
3
+ metadata.gz: 04d2dbefc9866810e87e1d7f7a79158babc863df
4
+ data.tar.gz: b294af2c773bce51618bdb476463c4b36a9ed8ce
5
5
  SHA512:
6
- metadata.gz: 7a704ef59a141d64c4248c72e714ac5c83e5b061fa2755f52f67102ffee717079b17aa41178456d5e2fde19f56c8c0acdf6d0577850062ce89d0c6ab91fd926e
7
- data.tar.gz: aa5a847b49ec8a6fb3b1681681a9a88410e54d75a7d60cff57da5e05c6f88eb97ad5bce585ed080c429a2237004b95fbd0dcf98272ea50879bf6b8e9ff310dac
6
+ metadata.gz: 5c72d6e9e538d0bd8e1a35252b3f2fcc741bcac19802f2f121eb3b2fea3a8090e541a736e04415abbc66a20733fc7e8d7dd68633fd9005e45ca29c04b7d6f266
7
+ data.tar.gz: 2da7a518b533f7817bce756a21cc361f6a6b9b3c6f3139744403e7e76aac410624c99d7f00050e75cf61c2ccc41ae0a288c4959bd729c77d13a504b2f0cd23e7
@@ -46,3 +46,10 @@ object CheckCommand "htmon-load" {
46
46
  vars.htmon_metric = "load"
47
47
  }
48
48
 
49
+ object CheckCommand "htmon-update" {
50
+ import "htmon-command"
51
+
52
+ command = [ LocalBin + "/check_htmon" ]
53
+
54
+ vars.htmon_metric = "packages"
55
+ }
@@ -9,6 +9,7 @@ object Host "sample.moo.gl" {
9
9
 
10
10
  vars.htmon_hostname = "peter.moo.gl"
11
11
  vars.htmon_loadwarn = 1
12
+ vars.htmon_updatewarn = 3
12
13
 
13
14
  }
14
15
 
@@ -17,7 +17,7 @@ apply Service "process " for (process in host.vars.htmon_processes) {
17
17
  assign where host.vars.htmon_processes != null
18
18
  }
19
19
 
20
- apply Service "htmon_load" {
20
+ apply Service "load" {
21
21
  import "generic-service"
22
22
 
23
23
  check_command = "htmon-load"
@@ -27,3 +27,13 @@ apply Service "htmon_load" {
27
27
  assign where host.vars.htmon_hostname && host.vars.htmon_loadwarn
28
28
  }
29
29
 
30
+ apply Service "updates" {
31
+ import "generic-service"
32
+
33
+ check_command = "htmon-update"
34
+
35
+ vars.htmon_warn = host.vars.htmon_updatewarn
36
+ vars.htmon_hostname = host.vars.htmon_hostname
37
+ assign where host.vars.htmon_hostname && host.vars.htmon_updatewarn
38
+ }
39
+
@@ -118,4 +118,5 @@ require_relative 'modules/keepalive'
118
118
  require_relative 'modules/process'
119
119
  require_relative 'modules/packages'
120
120
  require_relative 'modules/load'
121
+ require_relative 'modules/filesystemusage'
121
122
 
@@ -0,0 +1,46 @@
1
+
2
+ module Htmon
3
+ module Icinga
4
+ class Module
5
+ class Filesystemusage < Module
6
+
7
+ Value ||= Struct.new(:name, :usage)
8
+
9
+ callback :handle_value do |value, metric|
10
+ Value.new(metric.split("::").last, value.to_i)
11
+ end
12
+
13
+ callback :on_ok do |value, warn, thresh|
14
+ if value.usage < (thresh || warn || 85)
15
+ out = [value.usage, (warn || 85), (thresh || 95)].map do |x|
16
+ "#{x}%"
17
+ end.join(';')
18
+ "Filesystem usage for #{value.name.inspect} (#{value.usage}%) is ok "+
19
+ "| usage=#{out}"
20
+ end
21
+ end
22
+
23
+ callback :on_warn do |value, warn, thresh|
24
+ if value.usage < (thresh || 95)
25
+ out = [value.usage, (warn || 85), (thresh || 95)].map do |x|
26
+ "#{x}%"
27
+ end.join(';')
28
+ "Filesystem usage for #{value.name.inspect} (#{value.usage}%) is disturbing "+
29
+ "| usage=#{out}"
30
+ end
31
+ end
32
+
33
+ callback :on_crit do |value, warn, thresh|
34
+ if value.usage >= (thresh || 95)
35
+ out = [value.usage, (warn || 85), (thresh || 95)].map do |x|
36
+ "#{x}%"
37
+ end.join(';')
38
+ "Filesystem usage for #{value.name.inspect} (#{value.usage}%) is critical "+
39
+ "| usage=#{out}"
40
+ end
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,5 +1,5 @@
1
1
  module Htmon
2
2
  module Icinga
3
- VERSION = "0.3.4"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmon-icinga
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Foerster
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-21 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,6 +105,7 @@ files:
105
105
  - icinga_conf/services.conf
106
106
  - lib/htmon/icinga.rb
107
107
  - lib/htmon/icinga/module.rb
108
+ - lib/htmon/icinga/modules/filesystemusage.rb
108
109
  - lib/htmon/icinga/modules/keepalive.rb
109
110
  - lib/htmon/icinga/modules/load.rb
110
111
  - lib/htmon/icinga/modules/packages.rb