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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e285df3cf03a0ad9afb144ba89b3b005cb2f1fa
4
- data.tar.gz: f84e38f2c87f337acd65d23201840b5113139159
3
+ metadata.gz: 0e420a1e5fafbd84bc572134bee162f9538ea77f
4
+ data.tar.gz: 38b328cf7f3b8c58dd01a4c658a27ed8cec84228
5
5
  SHA512:
6
- metadata.gz: 85fe85816239b1982b4f2f0bf1e3e45d3e4022c0793cd84fc9297e2cd06393da090e763a0c31315f36d30a7a372990e43006faf3252fea81b543b0e654dfa51c
7
- data.tar.gz: e964154477a24d435b07a96e029ef2b38350dbafd182b089a3f198b8a9033284d642c0271baa8ed88e17503e3dbb53dafcc9a3b9566763b8ff85fba227ac4776
6
+ metadata.gz: 88bf16e6b0eb6c23c01b38de31c60b2a58e364b291eaaa412187659e40a5c211bca700784e12d0bd31e95609d99df32c212dbcf77dc7fde22840a97c2cfc8722
7
+ data.tar.gz: ddf24fd256f23fcd9e83b764bdf15a7dcafcfb5cdc5965944282d57e23af6d9664c96b2bd551d41744bd3555096c840013ee380a9cada8a105fd91a37404d53c
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudstack-nagios (0.8.1)
5
- cloudstack_client (~> 0.4, >= 0.4.4)
4
+ cloudstack-nagios (0.9.0)
5
+ cloudstack_client (~> 0.5, >= 0.5.0)
6
6
  erubis (~> 2.7.0)
7
7
  highline (~> 1.6.20)
8
8
  sshkit (~> 1.3.0)
@@ -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.4', '>= 0.4.4')
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']} usage=#{data[1]}%"
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"))
@@ -116,7 +116,7 @@ class Router < CloudstackNagios::Base
116
116
  end
117
117
  host = SSHKit::Host.new("root@#{options[:host]}")
118
118
  host.ssh_options = sshoptions(options[:ssh_key])
119
- host.port = options[:port]
119
+ host.port = options[:ssh_port]
120
120
  host
121
121
  end
122
122
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module CloudstackNagios
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9.0"
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.8.2
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-07 00:00:00.000000000 Z
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.4'
47
+ version: '0.5'
48
48
  - - '>='
49
49
  - !ruby/object:Gem::Version
50
- version: 0.4.4
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.4'
57
+ version: '0.5'
58
58
  - - '>='
59
59
  - !ruby/object:Gem::Version
60
- version: 0.4.4
60
+ version: 0.5.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: thor
63
63
  requirement: !ruby/object:Gem::Requirement