zabbix_vhost 0.6.0 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/zabbix_vhost/cli.rb +8 -5
- data/lib/zabbix_vhost/config.rb +4 -4
- data/lib/zabbix_vhost/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e140ffbb7a8e7bdd27f7f2f62d5527a6ed74bee
|
4
|
+
data.tar.gz: a08706add8285bb358f9fdae5b65bd432010d994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20bd8ad27db30629a997f34d0b94cbe356c2b234a406e84ba09f0d24a7ae9d3b3c09933dbb97fbcca17b0efbbe4fc9d910e8b4682456a378b239f22466952e5f
|
7
|
+
data.tar.gz: 53f5070c150af561ec94df7ffca46338e0d047cdd77dd2d3e2a12cc8536caeb08054128c1a7753196f8bbe366c491165977e4428bbd9a4d326f69c6399992b96
|
data/Gemfile.lock
CHANGED
data/lib/zabbix_vhost/cli.rb
CHANGED
@@ -14,11 +14,14 @@ module ZabbixVhost
|
|
14
14
|
|
15
15
|
|
16
16
|
data = configurations.collect do |c|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
|
18
|
+
unless c.server_name.nil?
|
19
|
+
{
|
20
|
+
"{#DOMAIN}" => c.server_name,
|
21
|
+
"{#CONFIG_FILE}" => c.file_path
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end.compact
|
22
25
|
|
23
26
|
print JSON.generate({data: data})
|
24
27
|
|
data/lib/zabbix_vhost/config.rb
CHANGED
@@ -19,10 +19,10 @@ module ZabbixVhost
|
|
19
19
|
@config_content = File.read(@file_path)
|
20
20
|
## Controlliamo se siamo in apache
|
21
21
|
if_apache do
|
22
|
-
@server_name = @config_content.match(/^\s
|
22
|
+
@server_name = @config_content.match(/^\s*ServerName (?<server_name>.*)/)[:server_name]
|
23
23
|
|
24
|
-
if @config_content.match(/^\s
|
25
|
-
@server_alias = @config_content.match(/^\s
|
24
|
+
if @config_content.match(/^\s*ServerAlias/)
|
25
|
+
@server_alias = @config_content.match(/^\s*ServerAlias (?<names>.*)/)[:names].split(" ")
|
26
26
|
end
|
27
27
|
|
28
28
|
@ssl_active = !@config_content.match(/443/).nil?
|
@@ -78,7 +78,7 @@ module ZabbixVhost
|
|
78
78
|
private
|
79
79
|
|
80
80
|
def if_apache
|
81
|
-
if @config_content.match(/^\s
|
81
|
+
if @config_content.match(/^\s*ServerName/)
|
82
82
|
yield
|
83
83
|
end
|
84
84
|
end
|
data/lib/zabbix_vhost/version.rb
CHANGED