Commit 961b940e authored by Łukasz Nowak's avatar Łukasz Nowak

monitor: Review parameter names

parent 83a54e81
......@@ -14,7 +14,7 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = 25aacd9f1f8139fa1a31516eedc7a5eb
md5sum = 6c75441c334051d3c7d50f52b14eac0e
[template-monitor]
_update_hash_filename_ = instance-monitor.cfg.jinja2
......@@ -30,7 +30,7 @@ md5sum = 7f257f581e1e0fdec0dcfedd5ea6ddfd
[template-monitor-edgebot]
_update_hash_filename_ = instance-monitor-edgebot.cfg.jinja2
md5sum = e4bb096d12b2b82d1f1b743247f5500d
md5sum = a5cbf6d4d00a6341e5c3c92b567d8d63
[network-bench-cfg]
filename = network_bench.cfg.in
......
......@@ -2,15 +2,15 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"nameserver": {
"nameserver-list": {
"default": [],
"title": "Nameserver",
"title": "Nameservers",
"description": "List of name servers to use.",
"type": "array"
},
"check-frontend-ip": {
"check-frontend-ip-list": {
"default": [],
"title": "Default list of Frontend IPs to check",
"title": "Default frontend IPs to check",
"description": "Default list of Frontend IPs to check, if empty no constraint is used.",
"type": "array"
}
......
......@@ -35,7 +35,7 @@
"type": "object",
"default": {}
},
"check-frontend-ip": {
"check-frontend-ip-list": {
"title": "Frontend IPs to check",
"description": "List of Frontend IPs to check, if empty no constraint is used (default: comes from master partition).",
"type": "array"
......
......@@ -17,7 +17,7 @@
{%- do slave.setdefault('check-certificate-expiration-days', 15) %}
{%- do slave.setdefault('failure-amount', 2) %}
{%- do slave.setdefault('check-maximum-elapsed-time', 2) %}
{%- do slave.setdefault('check-frontend-ip', CONFIGURATION['check-frontend-ip']) %}
{%- do slave.setdefault('check-frontend-ip-list', CONFIGURATION['check-frontend-ip-list']) %}
{%- if 'url' in slave %}
{%- set class = slave['check-maximum-elapsed-time'] %}
{%- if class not in slave_instance_dict %}
......@@ -46,7 +46,7 @@ config-http-header-dict = {{ json_module.dumps(slave['check-http-header-dict'])
config-certificate-expiration-days = {{ slave['check-certificate-expiration-days'] }}
config-failure-amount = {{ slave['failure-amount'] }}
config-maximum-elapsed-time = {{ slave['check-maximum-elapsed-time'] }}
config-ip-list = {{ ' '.join(slave['check-frontend-ip']) }}
config-ip-list = {{ ' '.join(slave['check-frontend-ip-list']) }}
config-json-file = ${surykatka-config-{{ class }}:json}
{%- endfor %}
......@@ -63,7 +63,7 @@ db = ${directory:srv}/surykatka-{{ class }}.db
rendered = ${directory:etc}/surykatka-{{ class }}.ini
template = {{ template_surykatka_ini }}
slave_instance_list = {{ dumps(slave_instance_list) }}
nameserver_list = {{ dumps(CONFIGURATION['nameserver']) }}
nameserver_list = {{ dumps(CONFIGURATION['nameserver-list']) }}
json = ${directory:srv}/surykatka-{{ class }}.json
{#- timeout is just a bit bigger than class time #}
timeout = {{ int(class) + 2 }}
......
......@@ -75,8 +75,8 @@ url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
# Defaults
configuration.nameserver =
configuration.check-frontend-ip =
configuration.nameserver-list =
configuration.check-frontend-ip-list =
# use monitor-base-port to have monitor listening on each instance
# on different port and also on different port than other services
# it makes it possible to instantiate it correctly on signle IP, for
......
......@@ -283,7 +283,7 @@ TIMEOUT = 4
SQLITE = %(db_file)s
URL =
https://www.checkcertificateexpirationdays.org/
https://www.checkfrontendip.org/
https://www.checkfrontendiplist.org/
https://www.checkhttpheaderdict.org/
https://www.checkstatuscode.org/
https://www.default.org/
......@@ -389,7 +389,7 @@ URL =
self.surykatka_dict[2]['json-file'],))
self.assertPromiseContent(
'http-query-checkfrontendip-promise.py',
'http-query-checkfrontendiplist-promise.py',
"""extra_config_dict = { 'certificate-expiration-days': '15',
'failure-amount': '2',
'http-header-dict': '{}',
......@@ -398,7 +398,7 @@ URL =
'maximum-elapsed-time': '2',
'report': 'http_query',
'status-code': '200',
'url': 'https://www.checkfrontendip.org/'}""" % (
'url': 'https://www.checkfrontendiplist.org/'}""" % (
self.surykatka_dict[2]['json-file'],))
def requestEdgetestSlaves(self):
......@@ -435,13 +435,13 @@ URL =
{'url': 'https://www.failureamount.org/', 'failure-amount': '10'},
)
self.requestEdgetestSlave(
'checkfrontendip',
{'url': 'https://www.checkfrontendip.org/',
'check-frontend-ip': ['128.129.130.131', '131.134.135.136']},
'checkfrontendiplist',
{'url': 'https://www.checkfrontendiplist.org/',
'check-frontend-ip-list': ['128.129.130.131', '131.134.135.136']},
)
class TestEdgeNameserverCheckFrontendIp(
class TestEdgeNameserverListCheckFrontendIpList(
EdgeSlaveMixin, SlapOSInstanceTestCase):
surykatka_dict = {
2: {'expected_ini': """[SURYKATKA]
......@@ -459,8 +459,8 @@ URL =
@classmethod
def getInstanceParameterDict(cls):
return {'_': json.dumps({
'nameserver': ['127.0.1.1', '127.0.1.2'],
'check-frontend-ip': ['127.0.0.1', '127.0.0.2'],
'nameserver-list': ['127.0.1.1', '127.0.1.2'],
'check-frontend-ip-list': ['127.0.0.1', '127.0.0.2'],
})}
def assertSurykatkaPromises(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment