zabbix_vhost 0.2.0 → 0.3.0
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 +6 -4
- data/lib/zabbix_vhost/config.rb +12 -5
- data/lib/zabbix_vhost/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3a82ecd7e8909e471a8cd85279169faf77c5656
|
4
|
+
data.tar.gz: d26080f7cf935db4d9cb1e3793a158018d92fd2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 070024c271854b1dc3e4d1573a0a1dfc8bb8a158b554c9d4c94761ab4491eeb7a3e6bc79be823716bfbcc82d3b808c5e0583c06ac4b812e21ddd0c3b975f54ea
|
7
|
+
data.tar.gz: 9c329774ae85a63bb3f6d09f915a54927f2e5acc118c3473dc3adf4eb6c43c9deb33ecf3d60eca74b348557938cc25bdbcd62192e039fc152fcb200ed8d5f024
|
data/Gemfile.lock
CHANGED
data/lib/zabbix_vhost/cli.rb
CHANGED
@@ -6,6 +6,7 @@ module ZabbixVhost
|
|
6
6
|
|
7
7
|
|
8
8
|
desc "autodiscover PATH", "Autodiscover Vhost in absolute path"
|
9
|
+
|
9
10
|
def autodiscover(path)
|
10
11
|
|
11
12
|
|
@@ -14,7 +15,8 @@ module ZabbixVhost
|
|
14
15
|
|
15
16
|
data = configurations.collect do |c|
|
16
17
|
{
|
17
|
-
"{#DOMAIN}" => c.server_name
|
18
|
+
"{#DOMAIN}" => c.server_name,
|
19
|
+
"{#CONFIG_FILE}" => c.file_path
|
18
20
|
}
|
19
21
|
end
|
20
22
|
|
@@ -24,11 +26,11 @@ module ZabbixVhost
|
|
24
26
|
end
|
25
27
|
|
26
28
|
|
27
|
-
desc "get_domain_data
|
29
|
+
desc "get_domain_data CONFIG_FILE FUNCTION", "Get a information from the Vhost configuration of CONFIG_FILE"
|
28
30
|
|
29
|
-
def get_domain_data(
|
31
|
+
def get_domain_data(config_file, function)
|
30
32
|
|
31
|
-
c = ZabbixVhost::Config.
|
33
|
+
c = ZabbixVhost::Config.new(config_file)
|
32
34
|
|
33
35
|
print c.send(function)
|
34
36
|
end
|
data/lib/zabbix_vhost/config.rb
CHANGED
@@ -58,11 +58,7 @@ module ZabbixVhost
|
|
58
58
|
end
|
59
59
|
|
60
60
|
|
61
|
-
|
62
|
-
if @config_content.match(/ServerName/)
|
63
|
-
yield
|
64
|
-
end
|
65
|
-
end
|
61
|
+
|
66
62
|
|
67
63
|
def ssl_active
|
68
64
|
@ssl_active ? 1 : 0
|
@@ -73,9 +69,20 @@ module ZabbixVhost
|
|
73
69
|
@ssl_data[:days_until]
|
74
70
|
end
|
75
71
|
|
72
|
+
def ssl_issuer
|
73
|
+
return nil unless @ssl_data
|
74
|
+
@ssl_data[:issuer]
|
75
|
+
end
|
76
|
+
|
76
77
|
|
77
78
|
private
|
78
79
|
|
80
|
+
def if_apache
|
81
|
+
if @config_content.match(/ServerName/)
|
82
|
+
yield
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
79
86
|
def read_ssl_data
|
80
87
|
|
81
88
|
if @ssl_active
|
data/lib/zabbix_vhost/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabbix_vhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marino Bonetti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|