cloudstack-nagios 0.13.0 → 0.14.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: dd79f250d420ee0506a8efdafd3b92f79070ef7d
4
- data.tar.gz: 0419a67d851a0b97d598bdf6968713f1a157dd8e
3
+ metadata.gz: c1b9fb35c6281bdd605b97909176bbb7b843522f
4
+ data.tar.gz: 40c58513ae8ace402630751bf7d0273bd9f8a8a7
5
5
  SHA512:
6
- metadata.gz: 1f6f08315d50ef0559d759b1a2b83f3c250f5bd457036d91caa76c2b0032fbb8e142c6f849090c1679b019c210b168d3fc4a7ff70f7b914e6613f0569b980070
7
- data.tar.gz: b13037841df8235e9970102d3f2fc3692e54a80d8d9a30700405be68f65d52c7894ac895537c5e0bb5dcfd7ea4fe1927f59d4792f110e1771482148476847375
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
+ }
@@ -1,3 +1,3 @@
1
1
  module CloudstackNagios
2
- VERSION = "0.13.0"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack-nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm