cloudstack-nagios 0.14.1 → 0.14.2

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: e60f71a3b197496f85fef00bca4e535cfb7105b3
4
- data.tar.gz: 4c8d19332857d31098208a4ceade29516cc38f52
3
+ metadata.gz: 944d22aba5a8a1b41bcfdd7d6ae63ca86af3d082
4
+ data.tar.gz: cfc0d40ecc78b6ab5cf50de2a8be47f3160a9a94
5
5
  SHA512:
6
- metadata.gz: a60b073f8e4494b492e0ed8e8cb71d5b212cea49631bc4def23424768f7eb55336bb8065288b08c50db1154c104e4eee7c5595308dbef2fc3382a3e20cb7e245
7
- data.tar.gz: 5b0e5efdf0eb610b8f51e76f9e337f792abf464ca5af3adf5533b4dc09052de250ffa524fe29438cd62a1ca82a6a40f883b8d2fd44019c9b90f2bf942deb837f
6
+ metadata.gz: 37869a07b4fb19e67a8f8f24ae58bafda2230260f0f7383fae1762d850ebf8ac8e533649b70dac74704d4222262bd2fd47e2757d9a38808d4b7e4039d8b9c79d
7
+ data.tar.gz: 12b065a279fdee3e75e7cd5c3cbd461665bf4fd2760fb43d3bd2078db15183f636384fdd385718128e87ba873919f10b002629903857d7a1cf2bae48d3fdfe5a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudstack-nagios (0.14.0)
4
+ cloudstack-nagios (0.14.2)
5
5
  cloudstack_client (~> 0.5, >= 0.5.0)
6
6
  erubis (~> 2.7.0)
7
7
  highline (~> 1.6.20)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Cloudstack Nagios
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/cloudstack-nagios.svg)](http://badge.fury.io/rb/cloudstack-nagios)
4
+
3
5
  Cloudstack Nagios helps you monitoring your Cloudstack environment with Nagios.
4
6
  Cloudstack Nagios uses the Cloudstack API to collect information about system vm's and ressources.
5
7
 
@@ -1,7 +1,7 @@
1
1
  module CloudstackNagios
2
2
  module Helper
3
3
  RETURN_CODES = {0 => 'ok', 1 => 'warning', 2 => 'critical'}
4
-
4
+
5
5
  def load_template(template_path)
6
6
  if File.file?(template_path)
7
7
  templ = Erubis::Eruby.new(File.read template_path)
@@ -19,7 +19,7 @@ module CloudstackNagios
19
19
  end
20
20
 
21
21
  def storage_pools
22
- storage_pools = client.list_storage_pools.select do |pool|
22
+ storage_pools = client.list_storage_pools.select do |pool|
23
23
  pool['state'].downcase == 'up'
24
24
  end
25
25
  end
@@ -34,13 +34,13 @@ module CloudstackNagios
34
34
  end
35
35
 
36
36
  def check_data(total, usage, warning, critical)
37
- usage_percent = 100.0 / total.to_f * usage.to_f
37
+ usage_percent = (100.0 / total.to_f * usage.to_f) || 0.0
38
38
  code = 3
39
39
  if usage_percent < warning
40
40
  code = 0
41
41
  elsif usage_percent < critical
42
42
  code = 1
43
- else
43
+ else
44
44
  code = 2
45
45
  end
46
46
  [code, usage_percent.round(0)]
@@ -1,3 +1,3 @@
1
1
  module CloudstackNagios
2
- VERSION = "0.14.1"
2
+ VERSION = "0.14.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-20 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc