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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/cloudstack-nagios/helper.rb +4 -4
- data/lib/cloudstack-nagios/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 944d22aba5a8a1b41bcfdd7d6ae63ca86af3d082
|
|
4
|
+
data.tar.gz: cfc0d40ecc78b6ab5cf50de2a8be47f3160a9a94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37869a07b4fb19e67a8f8f24ae58bafda2230260f0f7383fae1762d850ebf8ac8e533649b70dac74704d4222262bd2fd47e2757d9a38808d4b7e4039d8b9c79d
|
|
7
|
+
data.tar.gz: 12b065a279fdee3e75e7cd5c3cbd461665bf4fd2760fb43d3bd2078db15183f636384fdd385718128e87ba873919f10b002629903857d7a1cf2bae48d3fdfe5a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Cloudstack Nagios
|
|
2
2
|
|
|
3
|
+
[](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)]
|
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.
|
|
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-
|
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rdoc
|