Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
slapos
Commits
8aa104b1
Commit
8aa104b1
authored
Feb 15, 2024
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/monitor: Implement whois checks
parent
b3a71105
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
6 deletions
+57
-6
software/monitor/buildout.hash.cfg
software/monitor/buildout.hash.cfg
+1
-1
software/monitor/instance-edgetest-basic-input-schema.json
software/monitor/instance-edgetest-basic-input-schema.json
+14
-1
software/monitor/instance-monitor-edgetest-basic.cfg.jinja2
software/monitor/instance-monitor-edgetest-basic.cfg.jinja2
+4
-2
software/monitor/test/test.py
software/monitor/test/test.py
+38
-2
No files found.
software/monitor/buildout.hash.cfg
View file @
8aa104b1
...
...
@@ -22,7 +22,7 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
[template-monitor-edgetest-basic]
_update_hash_filename_ = instance-monitor-edgetest-basic.cfg.jinja2
md5sum = d
375f656087bfbd8a11188721e31de68
md5sum = d
210bb35a23421f0f8a685fea973eee4
[template-node-monitoring]
_update_hash_filename_ = instance-node-monitoring.jinja2.cfg
...
...
software/monitor/instance-edgetest-basic-input-schema.json
View file @
8aa104b1
...
...
@@ -44,6 +44,12 @@
"type"
:
"number"
,
"minimum"
:
1
},
"check-domain-expiration-days"
:
{
"title"
:
"Domain Expiration Check (days)"
,
"description"
:
"Amount of days to consider the domain as being to-be-expired. Defaults to global configuration."
,
"type"
:
"number"
,
"minimum"
:
1
},
"check-maximum-elapsed-time"
:
{
"title"
:
"Maximum Elapsed Check (seconds)"
,
"description"
:
"Maximum elapsed time for a site to reply to be considered good. Defaults to global configuration."
,
...
...
@@ -84,6 +90,13 @@
"default"
:
15
,
"minimum"
:
1
},
"check-domain-expiration-days"
:
{
"title"
:
"Default Domain Expiration Check (days)"
,
"description"
:
"Default amount of days to consider the domain as being to-be-expired."
,
"type"
:
"number"
,
"default"
:
30
,
"minimum"
:
1
},
"check-maximum-elapsed-time"
:
{
"title"
:
"Default Maximum Elapsed Check (seconds)"
,
"description"
:
"Default maximum elapsed time for a site to reply to be considered good."
,
...
...
@@ -102,7 +115,7 @@
"title"
:
"[EXPERT] Enabled Senses"
,
"description"
:
"Space separated list of enabled senses of the promise."
,
"type"
:
"string"
,
"default"
:
"dns_query tcp_server http_query ssl_certificate elapsed_time"
"default"
:
"dns_query
whois
tcp_server http_query ssl_certificate elapsed_time"
}
}
}
software/monitor/instance-monitor-edgetest-basic.cfg.jinja2
View file @
8aa104b1
...
...
@@ -3,13 +3,14 @@
'check-status-code': 200,
'check-http-header-dict': {},
'check-certificate-expiration-days': 15,
'check-domain-expiration-days': 30,
'failure-amount': 2,
'check-maximum-elapsed-time': 2,
'check-frontend-ip-list': [],
'nameserver-list': [],
'enabled-sense-list': 'dns_query tcp_server http_query ssl_certificate elapsed_time'
'enabled-sense-list': 'dns_query
whois
tcp_server http_query ssl_certificate elapsed_time'
} %}
{%- for default_key in ['check-frontend-ip-list', 'nameserver-list', 'check-status-code', 'check-certificate-expiration-days', 'check-maximum-elapsed-time', 'failure-amount', 'enabled-sense-list'] %}
{%- for default_key in ['check-frontend-ip-list', 'nameserver-list', 'check-status-code', 'check-certificate-expiration-days', 'check-
domain-expiration-days', 'check-
maximum-elapsed-time', 'failure-amount', 'enabled-sense-list'] %}
{%- if default_key in slapparameter_dict %}
{%- do DEFAULT_DICT.__setitem__(default_key, slapparameter_dict[default_key]) %}
{%- endif %}
...
...
@@ -66,6 +67,7 @@ config-url = {{ url }}
config-status-code = {{ check['check-status-code'] }}
config-http-header-dict = {{ json_module.dumps(check['check-http-header-dict']) }}
config-certificate-expiration-days = {{ check['check-certificate-expiration-days'] }}
config-domain-expiration-days = {{ check['check-domain-expiration-days'] }}
config-failure-amount = {{ check['failure-amount'] }}
config-maximum-elapsed-time = {{ check['check-maximum-elapsed-time'] }}
config-ip-list = {{ ' '.join(check['check-frontend-ip-list']) }}
...
...
software/monitor/test/test.py
View file @
8aa104b1
...
...
@@ -472,6 +472,12 @@ class TestEdgeBasic(EdgeMixin, SlapOSInstanceTestCase):
],
'check-http-header-dict'
:
{
"A"
:
"AAA"
},
},
"whois-check"
:
{
"url-list"
:
[
"https://whois.example.com"
,
],
"check-domain-expiration-days"
:
16
,
},
}
})}
...
...
@@ -496,6 +502,7 @@ URL =
https://header.example.com
https://path.example.com/path
https://status.example.com
https://whois.example.com
"""
},
11
:
{
'expected_ini'
:
"""[SURYKATKA]
INTERVAL = 120
...
...
@@ -516,8 +523,9 @@ URL =
def
getInstanceSoftwareType
(
cls
):
return
'edgetest-basic'
enabled_sense_list
=
"'dns_query tcp_server http_query ssl_certificate '
\
n
"
\
" 'elapsed_time'"
enabled_sense_list
=
\
"'dns_query whois tcp_server http_query ssl_certificate '
\
n
"
\
" 'elapsed_time'"
def
assertSurykatkaPromises
(
self
):
self
.
assertHttpQueryPromiseContent
(
...
...
@@ -525,6 +533,7 @@ URL =
'path-check'
,
'https://path.example.com/path'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -542,6 +551,7 @@ URL =
'domain-check'
,
'https://domain.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -559,6 +569,7 @@ URL =
'domain-check'
,
'http://domain.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -576,6 +587,7 @@ URL =
'frontend-check'
,
'https://frontend.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -593,6 +605,7 @@ URL =
'frontend-empty-check'
,
'https://frontendempty.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -610,6 +623,7 @@ URL =
'status-check'
,
'https://status.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -627,6 +641,7 @@ URL =
'certificate-check'
,
'https://certificate.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '11',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -644,6 +659,7 @@ URL =
'time-check'
,
'https://time.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
...
...
@@ -661,6 +677,7 @@ URL =
'failure-check'
,
'https://failure.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '3',
'http-header-dict': '{}',
...
...
@@ -678,6 +695,7 @@ URL =
'header-check'
,
'https://header.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '30',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{"A": "AAA"}',
...
...
@@ -690,6 +708,24 @@ URL =
self
.
enabled_sense_list
,
self
.
surykatka_dict
[
'edge0'
][
5
][
'json-file'
],))
self
.
assertHttpQueryPromiseContent
(
'edge0'
,
'whois-check'
,
'https://whois.example.com'
,
"""extra_config_dict = { 'certificate-expiration-days': '7',
'domain-expiration-days': '16',
'enabled-sense-list': %s,
'failure-amount': '1',
'http-header-dict': '{}',
'ip-list': '127.0.0.1 127.0.0.2',
'json-file': '%s',
'maximum-elapsed-time': '5',
'report': 'http_query',
'status-code': '201',
'url': 'https://whois.example.com'}"""
%
(
self
.
enabled_sense_list
,
self
.
surykatka_dict
[
'edge0'
][
5
][
'json-file'
],))
def
test
(
self
):
# Note: Those tests do not run surykatka and do not do real checks, as
# this depends too much on the environment and is really hard to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment