cloudstack-nagios 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/cloudstack-nagios.gemspec +1 -1
- data/lib/cloudstack-nagios/commands/capacity.rb +1 -1
- data/lib/cloudstack-nagios/commands/nagios_config.rb +10 -0
- data/lib/cloudstack-nagios/commands/router.rb +1 -1
- data/lib/cloudstack-nagios/templates/cloudstack_router_services.cfg.erb +5 -5
- data/lib/cloudstack-nagios/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e420a1e5fafbd84bc572134bee162f9538ea77f
|
4
|
+
data.tar.gz: 38b328cf7f3b8c58dd01a4c658a27ed8cec84228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88bf16e6b0eb6c23c01b38de31c60b2a58e364b291eaaa412187659e40a5c211bca700784e12d0bd31e95609d99df32c212dbcf77dc7fde22840a97c2cfc8722
|
7
|
+
data.tar.gz: ddf24fd256f23fcd9e83b764bdf15a7dcafcfb5cdc5965944282d57e23af6d9664c96b2bd551d41744bd3555096c840013ee380a9cada8a105fd91a37404d53c
|
data/Gemfile.lock
CHANGED
data/cloudstack-nagios.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_development_dependency('rdoc')
|
24
24
|
gem.add_development_dependency('rake', '~> 10.1.1')
|
25
25
|
|
26
|
-
gem.add_dependency('cloudstack_client', '~> 0.
|
26
|
+
gem.add_dependency('cloudstack_client', '~> 0.5', '>= 0.5.0')
|
27
27
|
gem.add_dependency('thor', '~> 0.18.1')
|
28
28
|
gem.add_dependency('erubis', '~> 2.7.0')
|
29
29
|
gem.add_dependency('sshkit', '~> 1.3.0')
|
@@ -25,7 +25,7 @@ class Capacity < CloudstackNagios::Base
|
|
25
25
|
def capacity_check(zone, type)
|
26
26
|
cap = client.list_capacity(type: type, zone: zone).first
|
27
27
|
data = check_data(cap['capacitytotal'].to_f, cap['capacityused'].to_f, options[:warning], options[:critical])
|
28
|
-
puts "#{CAPACITY_TYPES[type][:name]} #{RETURN_CODES[data[0]]} - usage = #{data[1]}% | usage=#{cap['capacityused']}
|
28
|
+
puts "#{CAPACITY_TYPES[type][:name]} #{RETURN_CODES[data[0]]} - usage = #{data[1]}% | usage=#{cap['capacityused']} usage_perc=#{data[1]}%"
|
29
29
|
exit data[0]
|
30
30
|
end
|
31
31
|
end
|
@@ -12,6 +12,14 @@ class NagiosConfig < CloudstackNagios::Base
|
|
12
12
|
type: :numeric,
|
13
13
|
default: 1000000,
|
14
14
|
aliases: '-s'
|
15
|
+
option :ssh_key,
|
16
|
+
desc: 'ssh private key to use',
|
17
|
+
default: '/var/lib/cloud/management/.ssh/id_rsa'
|
18
|
+
option :ssh_port,
|
19
|
+
desc: 'ssh port to use',
|
20
|
+
type: :numeric,
|
21
|
+
default: 3922,
|
22
|
+
aliases: '-p'
|
15
23
|
option :over_provisioning, type: :numeric, default: 1.0
|
16
24
|
def generate(*configs)
|
17
25
|
configs = get_configs(configs)
|
@@ -50,6 +58,8 @@ class NagiosConfig < CloudstackNagios::Base
|
|
50
58
|
capacity_types: Capacity::CAPACITY_TYPES,
|
51
59
|
storage_pools: pools,
|
52
60
|
over_provisioning: options[:over_provisioning],
|
61
|
+
ssh_key: options[:ssh_key],
|
62
|
+
ssh_port: options[:ssh_port]
|
53
63
|
)
|
54
64
|
end
|
55
65
|
footer = load_template(File.join(TEMPLATE_DIR, "footer.cfg.erb"))
|
@@ -1,31 +1,31 @@
|
|
1
1
|
|
2
2
|
define command {
|
3
3
|
command_name cs-nagios_check-memory
|
4
|
-
command_line <%= bin_path -%>cs-nagios check router memory -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
4
|
+
command_line <%= bin_path -%>cs-nagios check router memory -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --ssh-key <%= ssh_key %> --ssh-port <%= ssh_port %> --config <%= config_file %>
|
5
5
|
register 1
|
6
6
|
}
|
7
7
|
|
8
8
|
define command {
|
9
9
|
command_name cs-nagios_check-cpu
|
10
|
-
command_line <%= bin_path -%>cs-nagios check router cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
10
|
+
command_line <%= bin_path -%>cs-nagios check router cpu -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --ssh-key <%= ssh_key %> --ssh-port <%= ssh_port %> --config <%= config_file %>
|
11
11
|
register 1
|
12
12
|
}
|
13
13
|
|
14
14
|
define command {
|
15
15
|
command_name cs-nagios_check-network
|
16
|
-
command_line <%= bin_path -%>cs-nagios check router network -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --if-speed <%= if_speed %> --config <%= config_file %>
|
16
|
+
command_line <%= bin_path -%>cs-nagios check router network -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --if-speed <%= if_speed %> --ssh-key <%= ssh_key %> --ssh-port <%= ssh_port %> --config <%= config_file %>
|
17
17
|
register 1
|
18
18
|
}
|
19
19
|
|
20
20
|
define command {
|
21
21
|
command_name cs-nagios_check-rootfsrw
|
22
|
-
command_line <%= bin_path -%>cs-nagios check router rootfs_rw -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
22
|
+
command_line <%= bin_path -%>cs-nagios check router rootfs_rw -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --ssh-key <%= ssh_key %> --ssh-port <%= ssh_port %> --config <%= config_file %>
|
23
23
|
register 1
|
24
24
|
}
|
25
25
|
|
26
26
|
define command {
|
27
27
|
command_name cs-nagios_check-diskusage
|
28
|
-
command_line <%= bin_path -%>cs-nagios check router disk_usage -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
28
|
+
command_line <%= bin_path -%>cs-nagios check router disk_usage -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ --ssh-key <%= ssh_key %> --ssh-port <%= ssh_port %> --config <%= config_file %>
|
29
29
|
register 1
|
30
30
|
}
|
31
31
|
|
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.
|
4
|
+
version: 0.9.0
|
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-03-
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -44,20 +44,20 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.5'
|
48
48
|
- - '>='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.5.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
57
|
+
version: '0.5'
|
58
58
|
- - '>='
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.5.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: thor
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|