cloudstack-nagios 0.7.8 → 0.8.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 +4 -4
- data/Gemfile.lock +7 -7
- data/README.md +23 -49
- data/cloudstack-nagios.gemspec +2 -2
- data/lib/cloudstack-nagios/commands/capacity.rb +1 -1
- data/lib/cloudstack-nagios/commands/check.rb +1 -1
- data/lib/cloudstack-nagios/commands/nagios_config.rb +63 -93
- data/lib/cloudstack-nagios/helper.rb +7 -1
- data/lib/cloudstack-nagios/templates/cloudstack_async_jobs.cfg.erb +15 -0
- data/lib/cloudstack-nagios/templates/{cloudstack_capacity_services.cfg.erb → cloudstack_capacities.cfg.erb} +1 -22
- data/lib/cloudstack-nagios/templates/cloudstack_hostgroup.cfg.erb +6 -0
- data/lib/cloudstack-nagios/templates/cloudstack_router_hosts.cfg.erb +2 -27
- data/lib/cloudstack-nagios/templates/cloudstack_router_services.cfg.erb +45 -65
- data/lib/cloudstack-nagios/templates/cloudstack_storage_pools.cfg.erb +18 -0
- data/lib/cloudstack-nagios/templates/cloudstack_zone_hosts.cfg.erb +13 -0
- data/lib/cloudstack-nagios/templates/footer.cfg.erb +7 -0
- data/lib/cloudstack-nagios/templates/header.cfg.erb +12 -0
- data/lib/cloudstack-nagios/version.rb +1 -1
- metadata +13 -10
- data/lib/cloudstack-nagios/templates/cloudstack_api_hosts.cfg.erb +0 -39
- data/lib/cloudstack-nagios/templates/cloudstack_asyncjobs_services.cfg.erb +0 -35
- data/lib/cloudstack-nagios/templates/cloudstack_storage_pool_services.cfg.erb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 667b096bf7ec0a5da7a25e592a34be9ccc217910
|
4
|
+
data.tar.gz: 32a5cc461d2a9605b33263f89a7c6880218b17a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b4222049779b16307bb4d48dab4f6177d3717362f87d04f0630396ecf284c2948e0f2843295b4b16b379694da820d14e52ea5a082c6e2f01afaba564e7f42e0
|
7
|
+
data.tar.gz: ee48563afdde541e9b680cc31a2a9323608c02d354f3aa2e67e9115eaf6e6f28abe6f0173b83f105ae51910f370c58069ac5dab24a9749d7529280f6b2933b69
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cloudstack-nagios (0.
|
4
|
+
cloudstack-nagios (0.8.0)
|
5
5
|
cloudstack_client (~> 0.4, >= 0.4.4)
|
6
6
|
erubis (~> 2.7.0)
|
7
7
|
highline (~> 1.6.20)
|
8
|
-
sshkit (~> 1.
|
8
|
+
sshkit (~> 1.3.0)
|
9
9
|
thor (~> 0.18.1)
|
10
10
|
|
11
11
|
GEM
|
@@ -13,16 +13,16 @@ GEM
|
|
13
13
|
specs:
|
14
14
|
cloudstack_client (0.5.0)
|
15
15
|
erubis (2.7.0)
|
16
|
-
highline (1.6.
|
16
|
+
highline (1.6.21)
|
17
17
|
json (1.8.1)
|
18
18
|
net-scp (1.1.2)
|
19
19
|
net-ssh (>= 2.6.5)
|
20
20
|
net-ssh (2.8.0)
|
21
|
-
rake (10.
|
21
|
+
rake (10.1.1)
|
22
22
|
rdoc (4.1.1)
|
23
23
|
json (~> 1.4)
|
24
|
-
sshkit (1.
|
25
|
-
net-scp
|
24
|
+
sshkit (1.3.0)
|
25
|
+
net-scp (>= 1.1.2)
|
26
26
|
net-ssh
|
27
27
|
term-ansicolor
|
28
28
|
term-ansicolor (1.3.0)
|
@@ -35,5 +35,5 @@ PLATFORMS
|
|
35
35
|
|
36
36
|
DEPENDENCIES
|
37
37
|
cloudstack-nagios!
|
38
|
-
rake (~> 10.
|
38
|
+
rake (~> 10.1.1)
|
39
39
|
rdoc
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ The following checks are supported:
|
|
18
18
|
|
19
19
|
Install the cloudstack-cli gem:
|
20
20
|
|
21
|
-
```
|
21
|
+
```sh
|
22
22
|
$ gem install cloudstack-nagios
|
23
23
|
```
|
24
24
|
|
@@ -26,7 +26,7 @@ $ gem install cloudstack-nagios
|
|
26
26
|
|
27
27
|
Create the initial configuration:
|
28
28
|
|
29
|
-
```
|
29
|
+
```sh
|
30
30
|
$ cs-nagios setup
|
31
31
|
```
|
32
32
|
|
@@ -53,7 +53,7 @@ test:
|
|
53
53
|
|
54
54
|
See the help screen:
|
55
55
|
|
56
|
-
```
|
56
|
+
```sh
|
57
57
|
$ cs-nagios
|
58
58
|
```
|
59
59
|
|
@@ -61,48 +61,22 @@ $ cs-nagios
|
|
61
61
|
|
62
62
|
Generate all configuration files:
|
63
63
|
|
64
|
-
```
|
65
|
-
$ cs-nagios nagios_config
|
64
|
+
```sh
|
65
|
+
$ cs-nagios nagios_config generate all
|
66
66
|
```
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
```bash
|
81
|
-
$ cs-nagios nagios_config router_services
|
82
|
-
```
|
83
|
-
|
84
|
-
Generate nagios host configuration api hosts (one pseudo host per Cloudstack zone):
|
85
|
-
|
86
|
-
```bash
|
87
|
-
$ cs-nagios nagios_config api_hosts
|
88
|
-
```
|
89
|
-
|
90
|
-
Generate nagios service configuration for storage pool checks:
|
91
|
-
|
92
|
-
```bash
|
93
|
-
$ cs-nagios nagios_config storage_pool_services
|
94
|
-
```
|
95
|
-
|
96
|
-
Generate nagios service configuration for capacity checks:
|
97
|
-
|
98
|
-
```bash
|
99
|
-
$ cs-nagios nagios_config capacity_services
|
100
|
-
```
|
101
|
-
|
102
|
-
Generate nagios service configuration for async job checks:
|
103
|
-
|
104
|
-
```bash
|
105
|
-
$ cs-nagios nagios_config asyncjobs_services
|
67
|
+
You can also generate each config file individualy.
|
68
|
+
The following types are awailable:
|
69
|
+
|
70
|
+
```sh
|
71
|
+
$ cs-nagios nagios_config list
|
72
|
+
all
|
73
|
+
hostgroup
|
74
|
+
zone_hosts
|
75
|
+
router_hosts
|
76
|
+
router_services
|
77
|
+
capacities
|
78
|
+
async_jobs
|
79
|
+
storage_pools
|
106
80
|
```
|
107
81
|
|
108
82
|
### System VM checks
|
@@ -121,7 +95,7 @@ The following checks are available:
|
|
121
95
|
|
122
96
|
Example:
|
123
97
|
|
124
|
-
```
|
98
|
+
```sh
|
125
99
|
$ cs-nagios check system_vm network --host 10.100.9.161
|
126
100
|
```
|
127
101
|
|
@@ -140,7 +114,7 @@ Checks various global capacity values.
|
|
140
114
|
|
141
115
|
Example:
|
142
116
|
|
143
|
-
```
|
117
|
+
```sh
|
144
118
|
$ cs-nagios check capacity memory --zone ZUERICH_IX
|
145
119
|
```
|
146
120
|
|
@@ -150,7 +124,7 @@ Checks the available disk space on Cloudstack storage pools.
|
|
150
124
|
|
151
125
|
Example:
|
152
126
|
|
153
|
-
```
|
127
|
+
```sh
|
154
128
|
$ cs-nagios check storage_pool --pool_name fs_cs_zone01_pod01
|
155
129
|
```
|
156
130
|
|
@@ -160,7 +134,7 @@ Checks the number of pending async jobs.
|
|
160
134
|
|
161
135
|
Example:
|
162
136
|
|
163
|
-
```
|
137
|
+
```sh
|
164
138
|
$ cs-nagios check async_jobs
|
165
139
|
```
|
166
140
|
|
@@ -178,4 +152,4 @@ $ cs-nagios check async_jobs
|
|
178
152
|
|
179
153
|
## License
|
180
154
|
|
181
|
-
Released under the MIT License. See the [LICENSE](https://bitbucket.org/swisstxt/cloudstack-cli/raw/master/LICENSE.txt) file for further details.
|
155
|
+
Released under the MIT License. See the [LICENSE](https://bitbucket.org/swisstxt/cloudstack-cli/raw/master/LICENSE.txt) file for further details.
|
data/cloudstack-nagios.gemspec
CHANGED
@@ -21,11 +21,11 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.rdoc_options = %w[--line-numbers --inline-source]
|
22
22
|
|
23
23
|
gem.add_development_dependency('rdoc')
|
24
|
-
gem.add_development_dependency('rake', '~> 10.
|
24
|
+
gem.add_development_dependency('rake', '~> 10.1.1')
|
25
25
|
|
26
26
|
gem.add_dependency('cloudstack_client', '~> 0.4', '>= 0.4.4')
|
27
27
|
gem.add_dependency('thor', '~> 0.18.1')
|
28
28
|
gem.add_dependency('erubis', '~> 2.7.0')
|
29
|
-
gem.add_dependency('sshkit', '~> 1.
|
29
|
+
gem.add_dependency('sshkit', '~> 1.3.0')
|
30
30
|
gem.add_dependency('highline', '~> 1.6.20')
|
31
31
|
end
|
@@ -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=#{data[1]}%"
|
29
29
|
exit data[0]
|
30
30
|
end
|
31
31
|
end
|
@@ -51,7 +51,7 @@ class Check < CloudstackNagios::Base
|
|
51
51
|
options[:warning],
|
52
52
|
options[:critical]
|
53
53
|
)
|
54
|
-
puts "storage_pool #{options[:pool_name]} #{RETURN_CODES[data[0]]} - usage = #{data[1]}% | usage=#{pool['disksizeused']}"
|
54
|
+
puts "storage_pool #{options[:pool_name]} #{RETURN_CODES[data[0]]} - usage = #{data[1]}% | usage=#{pool['disksizeused']} usage=#{data[1]}%"
|
55
55
|
exit data[0]
|
56
56
|
end
|
57
57
|
|
@@ -1,116 +1,86 @@
|
|
1
1
|
class NagiosConfig < CloudstackNagios::Base
|
2
2
|
|
3
|
-
|
3
|
+
TEMPLATE_DIR = File.join(File.dirname(__FILE__), '..', 'templates')
|
4
4
|
|
5
|
-
|
6
|
-
def generate_all
|
7
|
-
commands = %w(router_hosts router_services api_hosts storage_pool_services capacity_services asyncjobs_services)
|
8
|
-
commands.each do |command|
|
9
|
-
invoke "nagios_config:#{command}"
|
10
|
-
puts
|
11
|
-
end
|
12
|
-
end
|
5
|
+
class_option :bin_path, desc: "absolute path to the nagios-cloudstack binary"
|
13
6
|
|
14
|
-
|
15
|
-
|
16
|
-
desc: "path of ERB template to use",
|
17
|
-
default: File.join(File.dirname(__FILE__), '..', 'templates', 'cloudstack_router_hosts.cfg.erb'),
|
7
|
+
class_option :template,
|
8
|
+
desc: "Path of ERB template to use. Only valid when generating a single configuration",
|
18
9
|
aliases: '-t'
|
19
|
-
def router_hosts
|
20
|
-
host_template = load_template(options[:template])
|
21
|
-
puts host_template.result(
|
22
|
-
routers: cs_routers,
|
23
|
-
date: date_string
|
24
|
-
)
|
25
|
-
end
|
26
10
|
|
27
|
-
|
28
|
-
option :template,
|
29
|
-
desc: "path of ERB template to use",
|
30
|
-
default: File.join(File.dirname(__FILE__), '..', 'templates', 'cloudstack_router_services.cfg.erb'),
|
31
|
-
aliases: '-t'
|
32
|
-
option :if_speed,
|
11
|
+
class_option :if_speed,
|
33
12
|
desc: 'network interface speed in bits per second',
|
34
13
|
type: :numeric,
|
35
14
|
default: 1000000,
|
36
15
|
aliases: '-s'
|
37
|
-
def router_services
|
38
|
-
service_template = load_template(options[:template])
|
39
|
-
puts service_template.result(
|
40
|
-
routers: cs_routers,
|
41
|
-
bin_path: bin_path,
|
42
|
-
if_speed: options[:if_speed],
|
43
|
-
config_file: options[:config],
|
44
|
-
date: date_string
|
45
|
-
)
|
46
|
-
end
|
47
|
-
|
48
|
-
desc "api_hosts", "generate nagios api host configuration"
|
49
|
-
option :template,
|
50
|
-
desc: "path of ERB template to use",
|
51
|
-
default: File.join(File.dirname(__FILE__), '..', 'templates', 'cloudstack_api_hosts.cfg.erb'),
|
52
|
-
aliases: '-t'
|
53
|
-
def api_hosts
|
54
|
-
service_template = load_template(options[:template])
|
55
|
-
puts service_template.result(
|
56
|
-
zones: client.list_zones,
|
57
|
-
bin_path: bin_path,
|
58
|
-
config_file: options[:config],
|
59
|
-
date: date_string
|
60
|
-
)
|
61
|
-
end
|
62
16
|
|
63
|
-
desc "
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
storage_pools = client.list_storage_pools.select do |pool|
|
72
|
-
pool['state'].downcase == 'up'
|
17
|
+
desc "generate [type]", "generate all nagios configs"
|
18
|
+
def generate(*configs)
|
19
|
+
configs = get_configs(configs)
|
20
|
+
if configs.size == 0
|
21
|
+
say "Please specify a valid configuration.", :green
|
22
|
+
say "Possible values are..."
|
23
|
+
invoke "nagios_config:list", []
|
24
|
+
exit
|
73
25
|
end
|
74
|
-
puts service_template.result(
|
75
|
-
storage_pools: storage_pools,
|
76
|
-
over_provisioning: options[:over_provisioning],
|
77
|
-
bin_path: bin_path,
|
78
|
-
config_file: options[:config],
|
79
|
-
date: date_string
|
80
|
-
)
|
81
|
-
end
|
82
26
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
bin_path: bin_path,
|
94
|
-
config_file: options[:config],
|
27
|
+
routers = configs.include?("router_hosts") ? cs_routers : nil
|
28
|
+
pools = configs.include?("storage_pools") ? storage_pools : nil
|
29
|
+
zones = client.list_zones
|
30
|
+
config_name = configs.size == 1 ?
|
31
|
+
"#{configs[0]} configuration" :
|
32
|
+
"all configurations"
|
33
|
+
|
34
|
+
header = load_template(File.join(TEMPLATE_DIR, "header.cfg.erb"))
|
35
|
+
output = header.result(
|
36
|
+
config_name: config_name,
|
95
37
|
date: date_string
|
96
38
|
)
|
39
|
+
configs.each do |config|
|
40
|
+
if configs.size == 1 && options[:template]
|
41
|
+
tmpl_file = options[:template]
|
42
|
+
else
|
43
|
+
tmpl_file = File.join(TEMPLATE_DIR, "cloudstack_#{config}.cfg.erb")
|
44
|
+
end
|
45
|
+
template = load_template(tmpl_file)
|
46
|
+
output += template.result(
|
47
|
+
routers: routers,
|
48
|
+
bin_path: bin_path,
|
49
|
+
if_speed: options[:if_speed],
|
50
|
+
config_file: options[:config],
|
51
|
+
zones: zones,
|
52
|
+
capacity_types: Capacity::CAPACITY_TYPES,
|
53
|
+
storage_pools: pools,
|
54
|
+
over_provisioning: options[:over_provisioning],
|
55
|
+
)
|
56
|
+
end
|
57
|
+
footer = load_template(File.join(TEMPLATE_DIR, "footer.cfg.erb"))
|
58
|
+
output += footer.result(
|
59
|
+
config_name: config_name
|
60
|
+
)
|
61
|
+
puts output
|
97
62
|
end
|
98
63
|
|
99
|
-
desc "
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
aliases: '-t'
|
104
|
-
def asyncjobs_services
|
105
|
-
service_template = load_template(options[:template])
|
106
|
-
puts service_template.result(
|
107
|
-
bin_path: bin_path,
|
108
|
-
config_file: options[:config],
|
109
|
-
date: date_string
|
110
|
-
)
|
64
|
+
desc "list", "show a list of possible configurations which can be generated."
|
65
|
+
def list
|
66
|
+
configs = get_configs
|
67
|
+
puts ["all"] << configs
|
111
68
|
end
|
112
69
|
|
113
70
|
no_commands do
|
71
|
+
|
72
|
+
def get_configs(configs = [])
|
73
|
+
all_configs = %w(hostgroup zone_hosts router_hosts router_services capacities async_jobs storage_pools)
|
74
|
+
if configs.size == 0
|
75
|
+
return all_configs
|
76
|
+
else
|
77
|
+
if configs.size == 1 && configs[0].downcase == "all"
|
78
|
+
return all_configs
|
79
|
+
end
|
80
|
+
return all_configs.select { |config| configs.include? config }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
114
84
|
def date_string
|
115
85
|
Time.new.strftime("%d.%m.%Y - %H:%M:%S")
|
116
86
|
end
|
@@ -8,7 +8,7 @@ module CloudstackNagios
|
|
8
8
|
templ.filename = template_path
|
9
9
|
return templ
|
10
10
|
else
|
11
|
-
say "Error:
|
11
|
+
say "Error: Template \"#{template_path}\" not found.", :red
|
12
12
|
exit 1
|
13
13
|
end
|
14
14
|
end
|
@@ -18,6 +18,12 @@ module CloudstackNagios
|
|
18
18
|
routers += client.list_routers(projectid: -1, status: 'Running')
|
19
19
|
end
|
20
20
|
|
21
|
+
def storage_pools
|
22
|
+
storage_pools = client.list_storage_pools.select do |pool|
|
23
|
+
pool['state'].downcase == 'up'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
21
27
|
def exit_with_failure(exception)
|
22
28
|
say 'ERROR: command execution failed!', :red
|
23
29
|
say "Message: ", :magenta
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
define command {
|
3
|
+
command_name cs-nagios_check-asyncjobs
|
4
|
+
command_line <%= bin_path -%>cs-nagios check async_jobs -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
5
|
+
register 1
|
6
|
+
}
|
7
|
+
|
8
|
+
define service {
|
9
|
+
hostgroup_name Cloudstack
|
10
|
+
service_description Cloudstack Async Jobs
|
11
|
+
display_name Cloudstack Async Jobs
|
12
|
+
use Generic-Service,service-pnp
|
13
|
+
check_command cs-nagios_check-asyncjobs!80!90
|
14
|
+
register 1
|
15
|
+
}
|
@@ -1,16 +1,3 @@
|
|
1
|
-
###############################################################################
|
2
|
-
#
|
3
|
-
# Cloudstack capcity services configuration file
|
4
|
-
#
|
5
|
-
# Created by: cloudstack-nagios
|
6
|
-
# Date: <%= date %>
|
7
|
-
# Version: Nagios 3.x config file
|
8
|
-
#
|
9
|
-
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
-
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
-
#
|
12
|
-
###############################################################################
|
13
|
-
|
14
1
|
|
15
2
|
<% capacity_types.each do |cap_type, cap_values| -%>
|
16
3
|
define command {
|
@@ -20,11 +7,10 @@ define command {
|
|
20
7
|
}
|
21
8
|
|
22
9
|
<% end -%>
|
23
|
-
|
24
10
|
<% zones.each do |zone| -%>
|
25
11
|
<% capacity_types.each do |cap_type, cap_values| -%>
|
26
12
|
define service {
|
27
|
-
hostgroup_name Cloudstack
|
13
|
+
hostgroup_name Cloudstack
|
28
14
|
service_description Cloudstack <%= zone['name'] %> <%= cap_values[:name] %>
|
29
15
|
display_name Cloudstack <%= zone['name'] %> <%= cap_values[:method_name] %>
|
30
16
|
use Generic-Service,service-pnp
|
@@ -34,10 +20,3 @@ define service {
|
|
34
20
|
|
35
21
|
<% end -%>
|
36
22
|
<% end -%>
|
37
|
-
###############################################################################
|
38
|
-
#
|
39
|
-
# Service configuration file
|
40
|
-
#
|
41
|
-
# END OF FILE
|
42
|
-
#
|
43
|
-
###############################################################################
|
@@ -1,21 +1,3 @@
|
|
1
|
-
###############################################################################
|
2
|
-
#
|
3
|
-
# Host configuration file
|
4
|
-
#
|
5
|
-
# Created by: cloudstack-nagios
|
6
|
-
# Date: <%= date %>
|
7
|
-
# Version: Nagios 3.x config file
|
8
|
-
#
|
9
|
-
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
-
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
-
#
|
12
|
-
###############################################################################
|
13
|
-
|
14
|
-
define hostgroup {
|
15
|
-
hostgroup_name Cloudstack-SystemVM
|
16
|
-
alias Cloudstack-SystemVM
|
17
|
-
register 1
|
18
|
-
}
|
19
1
|
|
20
2
|
<% routers.each do |router| -%>
|
21
3
|
<% if router['linklocalip'] -%>
|
@@ -24,17 +6,10 @@ define host {
|
|
24
6
|
display_name <%= router['name'] %> (<%= router['linklocalip'] %>)<%= " - #{router['project']}" if router['project'] %> - <%= router['zonename'] %>
|
25
7
|
address <%= router['linklocalip'] %>
|
26
8
|
use Linux-Host,host-pnp
|
27
|
-
hostgroups Cloudstack
|
9
|
+
hostgroups Cloudstack
|
28
10
|
check_command check-host-alive
|
29
11
|
register 1
|
30
12
|
}
|
13
|
+
|
31
14
|
<% end -%>
|
32
15
|
<% end -%>
|
33
|
-
|
34
|
-
###############################################################################
|
35
|
-
#
|
36
|
-
# Host configuration file
|
37
|
-
#
|
38
|
-
# END OF FILE
|
39
|
-
#
|
40
|
-
###############################################################################
|
@@ -1,95 +1,75 @@
|
|
1
|
-
###############################################################################
|
2
|
-
#
|
3
|
-
# Service configuration file
|
4
|
-
#
|
5
|
-
# Created by: cloudstack-nagios
|
6
|
-
# Date: <%= date %>
|
7
|
-
# Version: Nagios 3.x config file
|
8
|
-
#
|
9
|
-
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
-
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
-
#
|
12
|
-
###############################################################################
|
13
1
|
|
14
2
|
define command {
|
15
|
-
command_name
|
16
|
-
command_line
|
17
|
-
register
|
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 %>
|
5
|
+
register 1
|
18
6
|
}
|
19
7
|
|
20
8
|
define command {
|
21
|
-
command_name
|
22
|
-
command_line
|
23
|
-
register
|
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 %>
|
11
|
+
register 1
|
24
12
|
}
|
25
13
|
|
26
14
|
define command {
|
27
|
-
command_name
|
28
|
-
command_line
|
29
|
-
register
|
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 %>
|
17
|
+
register 1
|
30
18
|
}
|
31
19
|
|
32
20
|
define command {
|
33
|
-
command_name
|
34
|
-
command_line
|
35
|
-
register
|
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 %>
|
23
|
+
register 1
|
36
24
|
}
|
37
25
|
|
38
26
|
define command {
|
39
|
-
command_name
|
40
|
-
command_line
|
41
|
-
register
|
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 %>
|
29
|
+
register 1
|
42
30
|
}
|
43
31
|
|
44
32
|
define service {
|
45
|
-
hostgroup_name
|
46
|
-
service_description
|
47
|
-
display_name
|
48
|
-
use
|
49
|
-
check_command
|
50
|
-
register
|
33
|
+
hostgroup_name Cloudstack-SystemVM
|
34
|
+
service_description Memory
|
35
|
+
display_name Memory
|
36
|
+
use Generic-Service,service-pnp
|
37
|
+
check_command cs-nagios_check-memory!80!90
|
38
|
+
register 1
|
51
39
|
}
|
52
40
|
|
53
41
|
define service {
|
54
|
-
hostgroup_name
|
55
|
-
service_description
|
56
|
-
display_name
|
57
|
-
use
|
58
|
-
check_command
|
59
|
-
register
|
42
|
+
hostgroup_name Cloudstack-SystemVM
|
43
|
+
service_description CPU
|
44
|
+
display_name CPU
|
45
|
+
use Generic-Service,service-pnp
|
46
|
+
check_command cs-nagios_check-cpu!80!90
|
47
|
+
register 1
|
60
48
|
}
|
61
49
|
|
62
50
|
define service {
|
63
|
-
hostgroup_name
|
64
|
-
service_description
|
65
|
-
display_name
|
66
|
-
use
|
67
|
-
check_command
|
68
|
-
register
|
51
|
+
hostgroup_name Cloudstack-SystemVM
|
52
|
+
service_description Network
|
53
|
+
display_name Network
|
54
|
+
use Generic-Service,service-pnp
|
55
|
+
check_command cs-nagios_check-network!80!90
|
56
|
+
register 1
|
69
57
|
}
|
70
58
|
|
71
59
|
define service {
|
72
|
-
hostgroup_name
|
73
|
-
service_description
|
74
|
-
display_name
|
75
|
-
use
|
76
|
-
check_command
|
77
|
-
register
|
60
|
+
hostgroup_name Cloudstack-SystemVM
|
61
|
+
service_description RootFS rw
|
62
|
+
display_name RootFS rw
|
63
|
+
use Generic-Service,service-pnp
|
64
|
+
check_command cs-nagios_check-rootfsrw!80!90
|
65
|
+
register 1
|
78
66
|
}
|
79
67
|
|
80
68
|
define service {
|
81
|
-
hostgroup_name
|
82
|
-
service_description
|
83
|
-
display_name
|
84
|
-
use
|
85
|
-
check_command
|
86
|
-
register
|
69
|
+
hostgroup_name Cloudstack-SystemVM
|
70
|
+
service_description DiskUsage
|
71
|
+
display_name DiskUsage
|
72
|
+
use Generic-Service,service-pnp
|
73
|
+
check_command cs-nagios_check-diskusage!80!90
|
74
|
+
register 1
|
87
75
|
}
|
88
|
-
|
89
|
-
###############################################################################
|
90
|
-
#
|
91
|
-
# Service configuration file
|
92
|
-
#
|
93
|
-
# END OF FILE
|
94
|
-
#
|
95
|
-
###############################################################################
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
define command {
|
3
|
+
command_name cs-nagios_check-storage_pool
|
4
|
+
command_line <%= bin_path -%>cs-nagios check storage_pool --pool_name $ARG3$ --over_provisioning $ARG4$ -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
5
|
+
register 1
|
6
|
+
}
|
7
|
+
|
8
|
+
<% storage_pools.each do |storage_pool| -%>
|
9
|
+
define service {
|
10
|
+
hostgroup_name Cloudstack
|
11
|
+
service_description Cloudstack Storage Pool <%= storage_pool['zonename'] %> <%= storage_pool['name'] %>
|
12
|
+
display_name Cloudstack Storage Pool <%= storage_pool['zonename'] %> <%= storage_pool['name'] %>
|
13
|
+
use Generic-Service,service-pnp
|
14
|
+
check_command cs-nagios_check-storage_pool!80!90!<%= storage_pool['name'] %>!<%= over_provisioning %>
|
15
|
+
register 1
|
16
|
+
}
|
17
|
+
|
18
|
+
<% end -%>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
<% zones.each do |zone| -%>
|
3
|
+
define host {
|
4
|
+
host_name Cloudstack_<%= zone['name'] %>
|
5
|
+
display_name Cloudstack_<%= zone['name'] %>
|
6
|
+
address localhost
|
7
|
+
use Linux-Host,host-pnp
|
8
|
+
hostgroups Cloudstack
|
9
|
+
check_command check-host-alive
|
10
|
+
register 1
|
11
|
+
}
|
12
|
+
|
13
|
+
<% end -%>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Cloudstack - <%= config_name %>
|
4
|
+
#
|
5
|
+
# Created by: cloudstack-nagios
|
6
|
+
# Date: <%= date %>
|
7
|
+
# Version: Nagios 3.x config file
|
8
|
+
#
|
9
|
+
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
+
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
+
#
|
12
|
+
###############################################################################
|
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.8.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-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 10.
|
33
|
+
version: 10.1.1
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 10.
|
40
|
+
version: 10.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cloudstack_client
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 1.
|
95
|
+
version: 1.3.0
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - ~>
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 1.
|
102
|
+
version: 1.3.0
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: highline
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,12 +140,15 @@ files:
|
|
140
140
|
- lib/cloudstack-nagios/commands/snmpd_config.rb
|
141
141
|
- lib/cloudstack-nagios/files/snmpd.conf
|
142
142
|
- lib/cloudstack-nagios/helper.rb
|
143
|
-
- lib/cloudstack-nagios/templates/
|
144
|
-
- lib/cloudstack-nagios/templates/
|
145
|
-
- lib/cloudstack-nagios/templates/
|
143
|
+
- lib/cloudstack-nagios/templates/cloudstack_async_jobs.cfg.erb
|
144
|
+
- lib/cloudstack-nagios/templates/cloudstack_capacities.cfg.erb
|
145
|
+
- lib/cloudstack-nagios/templates/cloudstack_hostgroup.cfg.erb
|
146
146
|
- lib/cloudstack-nagios/templates/cloudstack_router_hosts.cfg.erb
|
147
147
|
- lib/cloudstack-nagios/templates/cloudstack_router_services.cfg.erb
|
148
|
-
- lib/cloudstack-nagios/templates/
|
148
|
+
- lib/cloudstack-nagios/templates/cloudstack_storage_pools.cfg.erb
|
149
|
+
- lib/cloudstack-nagios/templates/cloudstack_zone_hosts.cfg.erb
|
150
|
+
- lib/cloudstack-nagios/templates/footer.cfg.erb
|
151
|
+
- lib/cloudstack-nagios/templates/header.cfg.erb
|
149
152
|
- lib/cloudstack-nagios/version.rb
|
150
153
|
- lib/cloudstack_nagios.rb
|
151
154
|
homepage: https://github.com/swisstxt/cloudstack-nagios
|
@@ -1,39 +0,0 @@
|
|
1
|
-
###############################################################################
|
2
|
-
#
|
3
|
-
# Cloudstack API Host configuration file
|
4
|
-
#
|
5
|
-
# Created by: cloudstack-nagios
|
6
|
-
# Date: <%= date %>
|
7
|
-
# Version: Nagios 3.x config file
|
8
|
-
#
|
9
|
-
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
-
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
-
#
|
12
|
-
###############################################################################
|
13
|
-
|
14
|
-
define hostgroup {
|
15
|
-
hostgroup_name Cloudstack-API
|
16
|
-
alias Cloudstack-API
|
17
|
-
register 1
|
18
|
-
}
|
19
|
-
|
20
|
-
<% zones.each do |zone| -%>
|
21
|
-
define host {
|
22
|
-
host_name Cloudstack_<%= zone['name'] %>
|
23
|
-
display_name Cloudstack_<%= zone['name'] %>
|
24
|
-
address localhost
|
25
|
-
use Linux-Host,host-pnp
|
26
|
-
hostgroups Cloudstack-API
|
27
|
-
check_command check-host-alive
|
28
|
-
register 1
|
29
|
-
}
|
30
|
-
|
31
|
-
<% end -%>
|
32
|
-
|
33
|
-
###############################################################################
|
34
|
-
#
|
35
|
-
# Host configuration file
|
36
|
-
#
|
37
|
-
# END OF FILE
|
38
|
-
#
|
39
|
-
###############################################################################
|
@@ -1,35 +0,0 @@
|
|
1
|
-
###############################################################################
|
2
|
-
#
|
3
|
-
# Cloudstack async jobs services configuration file
|
4
|
-
#
|
5
|
-
# Created by: cloudstack-nagios
|
6
|
-
# Date: <%= date %>
|
7
|
-
# Version: Nagios 3.x config file
|
8
|
-
#
|
9
|
-
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
-
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
-
#
|
12
|
-
###############################################################################
|
13
|
-
|
14
|
-
define command {
|
15
|
-
command_name cs-nagios_check-asyncjobs
|
16
|
-
command_line <%= bin_path -%>cs-nagios check async_jobs -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
17
|
-
register 1
|
18
|
-
}
|
19
|
-
|
20
|
-
define service {
|
21
|
-
hostgroup_name Cloudstack-API
|
22
|
-
service_description Cloudstack Async Jobs
|
23
|
-
display_name Cloudstack Async Jobs
|
24
|
-
use Generic-Service,service-pnp
|
25
|
-
check_command cs-nagios_check-asyncjobs!80!90
|
26
|
-
register 1
|
27
|
-
}
|
28
|
-
|
29
|
-
###############################################################################
|
30
|
-
#
|
31
|
-
# Service configuration file
|
32
|
-
#
|
33
|
-
# END OF FILE
|
34
|
-
#
|
35
|
-
###############################################################################
|
@@ -1,38 +0,0 @@
|
|
1
|
-
###############################################################################
|
2
|
-
#
|
3
|
-
# Cloudstack storage_pool services configuration file
|
4
|
-
#
|
5
|
-
# Created by: cloudstack-nagios
|
6
|
-
# Date: <%= date %>
|
7
|
-
# Version: Nagios 3.x config file
|
8
|
-
#
|
9
|
-
# --- DO NOT EDIT THIS FILE BY HAND ---
|
10
|
-
# cloudstack-nagios will overwite all manual settings during the next update
|
11
|
-
#
|
12
|
-
###############################################################################
|
13
|
-
|
14
|
-
define command {
|
15
|
-
command_name cs-nagios_check-storage_pool
|
16
|
-
command_line <%= bin_path -%>cs-nagios check storage_pool --pool_name $ARG3$ --over_provisioning $ARG4$ -w $ARG1$ -c $ARG2$ --config <%= config_file %>
|
17
|
-
register 1
|
18
|
-
}
|
19
|
-
|
20
|
-
<% storage_pools.each do |storage_pool| -%>
|
21
|
-
define service {
|
22
|
-
hostgroup_name Cloudstack-API
|
23
|
-
service_description Cloudstack Storage Pool <%= storage_pool['name'] %>
|
24
|
-
display_name Cloudstack Storage Pool <%= storage_pool['name'] %>
|
25
|
-
use Generic-Service,service-pnp
|
26
|
-
check_command cs-nagios_check-storage_pool!80!90!<%= storage_pool['name'] %>!<%= over_provisioning %>
|
27
|
-
register 1
|
28
|
-
}
|
29
|
-
|
30
|
-
<% end -%>
|
31
|
-
|
32
|
-
###############################################################################
|
33
|
-
#
|
34
|
-
# Service configuration file
|
35
|
-
#
|
36
|
-
# END OF FILE
|
37
|
-
#
|
38
|
-
###############################################################################
|