vagrant-g5k 0.0.15 → 0.0.16

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +19 -0
  4. data/Vagrantfile +18 -31
  5. data/Vagrantfile.multisite +37 -0
  6. data/lib/vagrant-g5k/errors.rb +8 -3
  7. data/lib/vagrant-g5k/util/g5k_utils.rb +21 -13
  8. data/lib/vagrant-g5k/version.rb +1 -1
  9. data/locales/en.yml +5 -1
  10. data/results/.gitignore +2 -0
  11. data/results/README.md +43 -0
  12. data/results/Vagrantfile +126 -0
  13. data/results/ansible.cfg +2 -0
  14. data/results/boilerplate.retry +1 -0
  15. data/results/boilerplate.yml +248 -0
  16. data/results/files/grafana/dashboard.json +4572 -0
  17. data/results/files/grafana/dedicated.json +5486 -0
  18. data/results/files/grafana/haproxy.json +2632 -0
  19. data/results/files/heka/config.json +47 -0
  20. data/results/files/heka/heka-globals.toml +2 -0
  21. data/results/files/heka/lua_decoders/haproxy_log.lua +162 -0
  22. data/results/files/heka/lua_decoders/os_keystone_apache_log.lua +78 -0
  23. data/results/files/heka/lua_decoders/os_mysql_log.lua +56 -0
  24. data/results/files/heka/lua_decoders/os_openstack_log.lua +146 -0
  25. data/results/files/heka/lua_decoders/os_rabbitmq_log.lua +79 -0
  26. data/results/files/kibana/all_objects.json +81 -0
  27. data/results/files/nginx.conf +34 -0
  28. data/results/templates/heka-elasticsearch.toml.j2 +18 -0
  29. data/results/templates/heka-haproxy.toml.j2 +10 -0
  30. data/results/templates/heka-keystone.toml.j2 +14 -0
  31. data/results/templates/heka-mariadb.toml.j2 +14 -0
  32. data/results/templates/heka-openstack.toml.j2 +15 -0
  33. data/results/templates/heka-rabbitmq.toml.j2 +21 -0
  34. data/results/test.rb +32 -0
  35. metadata +28 -2
@@ -0,0 +1,47 @@
1
+ {
2
+ "command": "/usr/bin/hekad -config=/etc/heka/",
3
+ "config_files": [
4
+ {
5
+ "source": "/var/lib/kolla/config_files/heka-elasticsearch.toml",
6
+ "dest": "/etc/heka/heka-elasticsearch.toml",
7
+ "owner": "heka",
8
+ "perm": "0600",
9
+ "optional": true
10
+ },
11
+ {
12
+ "source": "/var/lib/kolla/config_files/heka-openstack.toml",
13
+ "dest": "/etc/heka/heka-openstack.toml",
14
+ "owner": "heka",
15
+ "perm": "0600",
16
+ "optional": true
17
+ },
18
+ {
19
+ "source": "/var/lib/kolla/config_files/heka-keystone.toml",
20
+ "dest": "/etc/heka/heka-keystone.toml",
21
+ "owner": "heka",
22
+ "perm": "0600",
23
+ "optional": true
24
+ },
25
+ {
26
+ "source": "/var/lib/kolla/config_files/heka-mariadb.toml",
27
+ "dest": "/etc/heka/heka-mariadb.toml",
28
+ "owner": "heka",
29
+ "perm": "0600",
30
+ "optional": true
31
+ },
32
+ {
33
+ "source": "/var/lib/kolla/config_files/heka-rabbitmq.toml",
34
+ "dest": "/etc/heka/heka-rabbitmq.toml",
35
+ "owner": "heka",
36
+ "perm": "0600",
37
+ "optional": true
38
+ },
39
+ {
40
+ "source": "/var/lib/kolla/config_files/heka-globals.toml",
41
+ "dest": "/etc/heka/heka-globals.toml",
42
+ "owner": "heka",
43
+ "perm": "0600",
44
+ "optional": true
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,2 @@
1
+ [hekad]
2
+ maxprocs=16
@@ -0,0 +1,162 @@
1
+ --[[
2
+
3
+ This is a decoder for custom haproxy logs.
4
+ e.g.
5
+ Jun 13 15:29:06 localhost.localdomain haproxy[33168]: 10.10.10.10 - - [13/Jun/2016:07:29:05 +0000] "POST /graph/pie HTTP/1.1" 200 848 "" "" 52591 218 "111.111.111.111_80" "my_app-demo.server.com_http_rr" "inst_13.136" 2 0 2 938 942 ---- 0 0 0 0 0 0 0 "" "" ""lb-node.server.com""
6
+
7
+ Config:
8
+ log_type = "haproxy.run.decoded", default value is "haproxy.run.default"
9
+
10
+ --]]
11
+
12
+ local dt = require "date_time"
13
+ local ip = require "ip_address"
14
+ local l = require 'lpeg'
15
+
16
+ l.locale(l)
17
+
18
+ local syslog = require "syslog"
19
+
20
+ require "cjson"
21
+
22
+
23
+ --[ grammar ]
24
+ local sp = l.space
25
+ local timestamp = "[" * l.Cg(dt.build_strftime_grammar("%d/%b/%Y:%H:%M:%S %z") * dt.time_secfrac / dt.time_to_ns, "Timestamp") * "]"
26
+ local log_date = l.Cg(dt.build_strftime_grammar("%b %d %H:%M:%S"), "LogDate")
27
+ local host = (l.alnum^1 + l.S("-_"))^1
28
+ local fqdn = (l.alnum^1 + l.S("-_."))^1
29
+ local slash = l.P"/"
30
+ local integer = (l.S("+-")^-1) * (l.digit^1)
31
+ local printusascii = l.R"!~"
32
+ local nilvalue = l.P"-"
33
+
34
+ local http_post = l.P"POST"
35
+ local http_get = l.P"GET"
36
+ local http_delete = l.P"DELETE"
37
+ local http_update = l.P"UPDATE"
38
+ local url = l.P"/"^1 * l.alnum^0
39
+ local http_method = l.Cg((http_post + http_get + http_delete + http_update)^1, "http_method")
40
+ local request_url = l.Cg(url^1, "request_url")
41
+ local http_version = l.Cg((l.P("HTTP") + l.P("HTTPS"))^1 * "/" * l.digit * "." * l.digit, "http_version")
42
+
43
+ local client_ip = l.Cg(ip.v4, "client_ip")
44
+ local gmt_date_time = "[" * l.Cg(dt.build_strftime_grammar("%d/%b/%Y:%H:%M:%S %z") / dt.time_to_ns, "gmt_date_time") * "]"
45
+ local http_request = l.Cg("\"" * l.Cg(http_method * sp * request_url * sp * http_version, "http_request") * "\"")
46
+ local status_code = l.Cg(l.digit * l.digit * l.digit, "status_code")
47
+ local bytes_read = l.Cg(l.digit^1 / tonumber, "bytes_read")
48
+ local client_port = l.Cg(l.digit^1, "client_port")
49
+ local accept_date_milliseconds = l.Cg(l.digit^1 / tonumber, "accept_date_milliseconds")
50
+ local frontend_name = "\"" * l.Cg(ip.v4 * "_" * l.digit^1, "frontend_name") * "\""
51
+ local backend_name = "\"" * l.Cg((l.alnum + l.S"-_.")^1, "backend_name") * "\""
52
+ local server_name = "\"" * l.Cg((l.alnum + l.S"-_.")^1, "server_name") * "\""
53
+ local Tq = l.Cg(integer / tonumber, "Tq")
54
+ local Tw = l.Cg(integer / tonumber, "Tw")
55
+ local Tc = l.Cg(integer / tonumber, "Tc")
56
+ local Tr = l.Cg(integer / tonumber, "Tr")
57
+ local Tt = l.Cg(integer / tonumber, "Tq")
58
+ local termination_state_with_cookie_status = l.Cg(( nilvalue + l.upper ) * ( nilvalue + l.upper ) * ( nilvalue + l.upper ) * ( nilvalue + l.upper ), "termination_state_with_cookie_status")
59
+ local actconn = l.Cg(integer / tonumber, "actconn")
60
+ local feconn = l.Cg(integer / tonumber, "feconn")
61
+ local beconn = l.Cg(integer / tonumber, "beconn")
62
+ local srv_conn = l.Cg(integer / tonumber, "srv_conn")
63
+ local retries = l.P"+"^-1 * l.Cg(l.digit^1 / tonumber, "retries")
64
+ local srv_queue = l.Cg(integer / tonumber, "srv_queue")
65
+ local backend_queue = l.Cg(integer / tonumber, "backend_queue")
66
+ local captured_request_cookie = l.Cg(printusascii^-255, "captured_request_cookie")
67
+ local captured_response_cookie = l.Cg(printusascii^-255, "captured_response_cookie")
68
+ local domain_name = "\"" * l.Cg((l.alnum + l.S"-_.")^1, "domain_name") * "\""
69
+
70
+ -- Returns an LPeg grammar based on the Haproxy log_format configuration string.
71
+ local function build_grammar()
72
+ local grm =
73
+ client_ip * sp * "- -" * sp
74
+ * gmt_date_time * sp
75
+ * "\"" * http_method * sp
76
+ * request_url * sp
77
+ * http_version * "\"" * sp
78
+ * status_code * sp
79
+ * bytes_read * sp
80
+ * "\"\"" * sp * "\"\"" * sp
81
+ * client_port * sp
82
+ * accept_date_milliseconds * sp
83
+ * frontend_name * sp
84
+ * backend_name * sp
85
+ * server_name * sp
86
+ * Tq * sp
87
+ * Tw * sp
88
+ * Tc * sp
89
+ * Tr * sp
90
+ * Tt * sp
91
+ * termination_state_with_cookie_status * sp
92
+ * actconn * sp
93
+ * feconn * sp
94
+ * beconn * sp
95
+ * srv_conn * sp
96
+ * retries * sp
97
+ * srv_queue * sp
98
+ * backend_queue * sp
99
+ * captured_request_cookie * sp
100
+ * captured_response_cookie * sp
101
+
102
+ return l.Ct(grm)
103
+ end
104
+
105
+ local msg = {
106
+ Timestamp = nil,
107
+ Hostname = nil,
108
+ Payload = nil,
109
+ Pid = nil,
110
+ Fields = nil
111
+ }
112
+
113
+ local default_log_type = "haproxy.run.default"
114
+ local default_syslog_format = "%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
115
+
116
+ --[ read config variables ]
117
+ local log_type = read_config("log_type") or default_log_type
118
+ local syslog_format = read_config("syslog_format") or default_syslog_format
119
+
120
+ local syslog_grammar = syslog.build_rsyslog_grammar(syslog_format)
121
+ local halog_grammar = build_grammar()
122
+
123
+ local msg = {
124
+ Timestamp = nil,
125
+ Type = nil,
126
+ Payload = nil,
127
+ Fields = nil
128
+ }
129
+
130
+ function process_message ()
131
+ local log = read_message("Payload")
132
+ local fields = syslog_grammar:match(log)
133
+ if not fields then return -1 end
134
+
135
+ msg.Timestamp = fields.timestamp
136
+ fields.timestamp = nil
137
+
138
+ msg.Type = log_type
139
+ msg.Payload = nil
140
+
141
+ msg.Pid = fields.syslogtag.pid or nil
142
+ fields.syslogtag = nil
143
+
144
+ msg.Hostname = fields.hostname
145
+ fields.hostname = nil
146
+
147
+ local m = halog_grammar:match(fields.msg)
148
+ if m then
149
+ -- fill all fields
150
+ for k,v in pairs(m) do
151
+ fields[k] = v
152
+ end
153
+ else
154
+ -- not matched, break
155
+ return -1
156
+ end
157
+
158
+ fields.msg = nil
159
+ msg.Fields = fields
160
+ inject_message(msg)
161
+ return 0
162
+ end
@@ -0,0 +1,78 @@
1
+ -- Copyright 2015 Mirantis, Inc.
2
+ --
3
+ -- Licensed under the Apache License, Version 2.0 (the "License");
4
+ -- you may not use this file except in compliance with the License.
5
+ -- You may obtain a copy of the License at
6
+ --
7
+ -- http://www.apache.org/licenses/LICENSE-2.0
8
+ --
9
+ -- Unless required by applicable law or agreed to in writing, software
10
+ -- distributed under the License is distributed on an "AS IS" BASIS,
11
+ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ -- See the License for the specific language governing permissions and
13
+ -- limitations under the License.
14
+
15
+ local l = require 'lpeg'
16
+ l.locale(l)
17
+
18
+ local common_log_format = require 'common_log_format'
19
+ local patt = require 'os_patterns'
20
+ local utils = require 'os_utils'
21
+
22
+ -- Allow custom type
23
+ t = read_config('type')
24
+ if t == nil or t == '' then
25
+ t = 'log'
26
+ end
27
+
28
+ local msg = {
29
+ Timestamp = nil,
30
+ Type = t,
31
+ Hostname = nil,
32
+ Payload = nil,
33
+ Pid = nil,
34
+ Fields = nil,
35
+ Severity = 6,
36
+ }
37
+
38
+ local severity_label = utils.severity_to_label_map[msg.Severity]
39
+
40
+ local apache_log_pattern = read_config("apache_log_pattern") or error(
41
+ "apache_log_pattern configuration must be specificed")
42
+ local apache_grammar = common_log_format.build_apache_grammar(apache_log_pattern)
43
+ local request_grammar = l.Ct(patt.http_request)
44
+
45
+ function process_message ()
46
+
47
+ -- logger is either "keystone-apache-public" or "keystone-apache-admin"
48
+ local logger = read_message("Logger")
49
+
50
+ local log = read_message("Payload")
51
+
52
+ local m
53
+
54
+ m = apache_grammar:match(log)
55
+ if m then
56
+ msg.Logger = 'openstack.keystone'
57
+ msg.Payload = log
58
+ msg.Timestamp = m.time
59
+
60
+ msg.Fields = {}
61
+ msg.Fields.http_status = m.status
62
+ msg.Fields.http_response_time = m.request_time.value / 1e6 -- us to sec
63
+ msg.Fields.programname = logger
64
+ msg.Fields.severity_label = severity_label
65
+
66
+ local request = m.request
67
+ m = request_grammar:match(request)
68
+ if m then
69
+ msg.Fields.http_method = m.http_method
70
+ msg.Fields.http_url = m.http_url
71
+ msg.Fields.http_version = m.http_version
72
+ end
73
+
74
+ return utils.safe_inject_message(msg)
75
+ end
76
+
77
+ return -1, string.format("Failed to parse %s log: %s", logger, string.sub(log, 1, 64))
78
+ end
@@ -0,0 +1,56 @@
1
+ -- Copyright 2015-2016 Mirantis, Inc.
2
+ --
3
+ -- Licensed under the Apache License, Version 2.0 (the "License");
4
+ -- you may not use this file except in compliance with the License.
5
+ -- You may obtain a copy of the License at
6
+ --
7
+ -- http://www.apache.org/licenses/LICENSE-2.0
8
+ --
9
+ -- Unless required by applicable law or agreed to in writing, software
10
+ -- distributed under the License is distributed on an "AS IS" BASIS,
11
+ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ -- See the License for the specific language governing permissions and
13
+ -- limitations under the License.
14
+ require "string"
15
+ local l = require 'lpeg'
16
+ l.locale(l)
17
+
18
+ local patt = require 'os_patterns'
19
+ local utils = require 'os_utils'
20
+
21
+ -- Allow custom type
22
+ t = read_config('type')
23
+ if t == nil or t == '' then
24
+ t = 'log'
25
+ end
26
+
27
+ local msg = {
28
+ Timestamp = nil,
29
+ Type = t,
30
+ Hostname = nil,
31
+ Payload = nil,
32
+ Pid = nil,
33
+ Fields = {},
34
+ Severity = nil,
35
+ }
36
+
37
+ local sp = patt.sp
38
+ local colon = patt.colon
39
+
40
+ -- mysqld logs are cranky,the date is YYMMMDD, the hours have no leading zero and the "real" severity level is enclosed by square brackets...
41
+ local mysql_grammar = l.Ct(l.digit^-6 * sp^1 * l.digit^-2 * colon * l.digit^-2 * colon * l.digit^-2 * sp^1 * l.P"[" * l.Cg(l.R("az", "AZ")^0 / string.upper, "SeverityLabel") * l.P"]" * sp^1 * l.Cg(patt.Message, "Message"))
42
+
43
+
44
+ function process_message ()
45
+ local log = read_message("Payload")
46
+ local logger = read_message("Logger")
47
+
48
+ local m = mysql_grammar:match(log)
49
+ if not m then return -1 end
50
+
51
+ msg.Logger = logger
52
+ msg.Payload = m.Message
53
+ msg.Fields.severity_label = m.SeverityLabel
54
+
55
+ return utils.safe_inject_message(msg)
56
+ end
@@ -0,0 +1,146 @@
1
+ -- Copyright 2015-2016 Mirantis, Inc.
2
+ --
3
+ -- Licensed under the Apache License, Version 2.0 (the "License");
4
+ -- you may not use this file except in compliance with the License.
5
+ -- You may obtain a copy of the License at
6
+ --
7
+ -- http://www.apache.org/licenses/LICENSE-2.0
8
+ --
9
+ -- Unless required by applicable law or agreed to in writing, software
10
+ -- distributed under the License is distributed on an "AS IS" BASIS,
11
+ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ -- See the License for the specific language governing permissions and
13
+ -- limitations under the License.
14
+ require "string"
15
+ require "table"
16
+ local l = require 'lpeg'
17
+ l.locale(l)
18
+
19
+ local patt = require 'os_patterns'
20
+ local utils = require 'os_utils'
21
+
22
+ -- Allow custom type
23
+ t = read_config('type')
24
+ if t == nil or t == '' then
25
+ t = 'log'
26
+ end
27
+
28
+ local msg = {
29
+ Timestamp = nil,
30
+ Type = t,
31
+ Hostname = nil,
32
+ Payload = nil,
33
+ Pid = nil,
34
+ Fields = nil,
35
+ Severity = nil,
36
+ }
37
+
38
+ -- traceback_lines is a reference to a table used to accumulate lines of
39
+ -- a Traceback. traceback_key represent the key of the Traceback lines
40
+ -- being accumulated in traceback_lines. This is used to know when to
41
+ -- stop accumulating and inject the Heka message.
42
+ local traceback_key = nil
43
+ local traceback_lines = nil
44
+
45
+ function prepare_message (service, timestamp, pid, severity_label,
46
+ python_module, programname, payload)
47
+ msg.Logger = 'openstack.' .. service
48
+ msg.Timestamp = timestamp
49
+ msg.Payload = payload
50
+ msg.Pid = pid
51
+ msg.Severity = utils.label_to_severity_map[severity_label] or 7
52
+ msg.Fields = {}
53
+ msg.Fields.severity_label = severity_label
54
+ msg.Fields.python_module = python_module
55
+ msg.Fields.programname = programname
56
+ msg.Payload = payload
57
+ end
58
+
59
+ -- OpenStack log messages are of this form:
60
+ -- 2015-11-30 08:38:59.306 3434 INFO oslo_service.periodic_task [-] Blabla...
61
+ --
62
+ -- [-] is the "request" part, it can take multiple forms.
63
+
64
+ function process_message ()
65
+
66
+ -- Logger is of form "<service>_<program>" (e.g. "nova_nova-api",
67
+ -- "neutron_l3-agent").
68
+ local logger = read_message("Logger")
69
+ local service, program = string.match(logger, '([^_]+)_(.+)')
70
+
71
+ local log = read_message("Payload")
72
+ local m
73
+
74
+ m = patt.openstack:match(log)
75
+ if not m then
76
+ return -1, string.format("Failed to parse %s log: %s", logger, string.sub(log, 1, 64))
77
+ end
78
+
79
+ local key = {
80
+ Timestamp = m.Timestamp,
81
+ Pid = m.Pid,
82
+ SeverityLabel = m.SeverityLabel,
83
+ PythonModule = m.PythonModule,
84
+ service = service,
85
+ program = program,
86
+ }
87
+
88
+ if traceback_key ~= nil then
89
+ -- If traceback_key is not nil then it means we've started accumulated
90
+ -- lines of a Python traceback. We keep accumulating the traceback
91
+ -- lines util we get a different log key.
92
+ if utils.table_equal(traceback_key, key) then
93
+ table.insert(traceback_lines, m.Message)
94
+ return 0
95
+ else
96
+ prepare_message(traceback_key.service, traceback_key.Timestamp,
97
+ traceback_key.Pid, traceback_key.SeverityLabel,
98
+ traceback_key.PythonModule, traceback_key.program,
99
+ table.concat(traceback_lines, ''))
100
+ traceback_key = nil
101
+ traceback_lines = nil
102
+ -- Ignore safe_inject_message status code here to still get a
103
+ -- chance to inject the current log message.
104
+ utils.safe_inject_message(msg)
105
+ end
106
+ end
107
+
108
+ if patt.traceback:match(m.Message) then
109
+ -- Python traceback detected, begin accumulating the lines making
110
+ -- up the traceback.
111
+ traceback_key = key
112
+ traceback_lines = {}
113
+ table.insert(traceback_lines, m.Message)
114
+ return 0
115
+ end
116
+
117
+ prepare_message(service, m.Timestamp, m.Pid, m.SeverityLabel, m.PythonModule,
118
+ program, m.Message)
119
+
120
+ m = patt.openstack_request_context:match(msg.Payload)
121
+ if m then
122
+ msg.Fields.request_id = m.RequestId
123
+ if m.UserId then
124
+ msg.Fields.user_id = m.UserId
125
+ end
126
+ if m.TenantId then
127
+ msg.Fields.tenant_id = m.TenantId
128
+ end
129
+ end
130
+
131
+ m = patt.openstack_http:match(msg.Payload)
132
+ if m then
133
+ msg.Fields.http_method = m.http_method
134
+ msg.Fields.http_status = m.http_status
135
+ msg.Fields.http_url = m.http_url
136
+ msg.Fields.http_version = m.http_version
137
+ msg.Fields.http_response_size = m.http_response_size
138
+ msg.Fields.http_response_time = m.http_response_time
139
+ m = patt.ip_address:match(msg.Payload)
140
+ if m then
141
+ msg.Fields.http_client_ip_address = m.ip_address
142
+ end
143
+ end
144
+
145
+ return utils.safe_inject_message(msg)
146
+ end