cloudstack-nagios 0.13.0 → 0.14.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b9fb35c6281bdd605b97909176bbb7b843522f
|
4
|
+
data.tar.gz: 40c58513ae8ace402630751bf7d0273bd9f8a8a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e470e259d36b8874cf52129dea7c149730c1675b53da52b7243a997aee5274de897d38d9fe7a48175c4b20ec69ba9f5fdc6b36a5d7fa6533f987657b61e7fdd0
|
7
|
+
data.tar.gz: deaaac2c91ed5b45a727dbc88edff81c94d715924a220e618ab39cdfbb9e14e6520614ba21c78862a197deba170aec973e2dad02dca44694df38687629d6db43
|
data/README.md
CHANGED
@@ -57,7 +57,7 @@ See the help screen:
|
|
57
57
|
$ cs-nagios
|
58
58
|
```
|
59
59
|
|
60
|
-
### Generate all Nagios configuration files at once
|
60
|
+
### Generate all Nagios configuration files at once
|
61
61
|
|
62
62
|
Generate all configuration files:
|
63
63
|
|
@@ -86,12 +86,14 @@ For all vm checks access to the cloudstack management network is required in ord
|
|
86
86
|
#### Check system vms over ssh
|
87
87
|
|
88
88
|
The following checks are available:
|
89
|
-
|
89
|
+
|
90
90
|
* memory - measure memory usage in percents
|
91
91
|
* cpu - measure cpu usage in percent
|
92
92
|
* network - measure network usage
|
93
93
|
* rootfs_rw - check if the root file system is writeable
|
94
94
|
* disk_usage - check the diks space usage of the root volume
|
95
|
+
* conntrack_connections, check the number of conntrack connections and set proper limits if needed
|
96
|
+
* active_ftp - make sure conntrack_ftp and nf_nat_ftp modules are loaded and enable it if needed
|
95
97
|
|
96
98
|
Example:
|
97
99
|
|
@@ -138,6 +138,36 @@ class Router < CloudstackNagios::Base
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
+
desc "active_ftp", "make sure conntrack_ftp and nf_nat_ftp modules are loaded"
|
142
|
+
def active_ftp
|
143
|
+
begin
|
144
|
+
host = systemvm_host
|
145
|
+
active_ftp_enabled = false
|
146
|
+
modules = %w(nf_conntrack_ftp, nf_nat_ftp)
|
147
|
+
on host do |h|
|
148
|
+
lsmod = capture(:lsmod)
|
149
|
+
active_ftp_enabled = lsmod.include?('nf_conntrack_ftp') &&
|
150
|
+
lsmod.include?('nf_nat_ftp')
|
151
|
+
unless active_ftp_enabled
|
152
|
+
# load the modules in the kernel
|
153
|
+
execute(:modprobe, 'nf_conntrack_ftp')
|
154
|
+
execute(:modprobe, 'nf_nat_ftp')
|
155
|
+
# load the modules at next server boot
|
156
|
+
execute(:echo, '"nf_conntrack_ftp" >> /etc/modules')
|
157
|
+
execute(:echo, '"nf_nat_ftp" >> /etc/modules')
|
158
|
+
active_ftp_enabled = true
|
159
|
+
end
|
160
|
+
end
|
161
|
+
rescue SSHKit::Command::Failed
|
162
|
+
active_ftp_enabled = false
|
163
|
+
rescue => e
|
164
|
+
exit_with_failure(e)
|
165
|
+
end
|
166
|
+
status = active_ftp_enabled ? 0 : 2
|
167
|
+
puts "ACTIVE_FTP #{active_ftp_enabled ? 'OK - active_ftp enabled' : 'CRITICAL - active_ftp NOT enabled'}"
|
168
|
+
exit status
|
169
|
+
end
|
170
|
+
|
141
171
|
no_commands do
|
142
172
|
|
143
173
|
def systemvm_host
|
@@ -35,6 +35,12 @@ define command {
|
|
35
35
|
register 1
|
36
36
|
}
|
37
37
|
|
38
|
+
define command {
|
39
|
+
command_name cs-nagios_check-active_ftp
|
40
|
+
command_line <%= bin_path -%>cs-nagios check router active_ftp -H $HOSTADDRESS$ --ssh-key <%= ssh_key %> --ssh-port <%= ssh_port %> --config <%= config_file %>
|
41
|
+
register 1
|
42
|
+
}
|
43
|
+
|
38
44
|
define service {
|
39
45
|
hostgroup_name CloudstackRouter
|
40
46
|
service_description Cloudstack Virtual Router Memory
|
@@ -97,3 +103,12 @@ define service {
|
|
97
103
|
check_command cs-nagios_check-conntrack_connections!80!90
|
98
104
|
register 1
|
99
105
|
}
|
106
|
+
|
107
|
+
define service {
|
108
|
+
hostgroup_name CloudstackRouter
|
109
|
+
service_description Cloudstack Virtual RouterActiveFTP
|
110
|
+
display_name Cloudstack Virtual RouterActiveFTP
|
111
|
+
use Generic-Service,service-pnp
|
112
|
+
check_command cs-nagios_check-active_ftp
|
113
|
+
register 1
|
114
|
+
}
|