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
Léo-Paul Géneau
slapos
Commits
429c0f3d
Commit
429c0f3d
authored
Jan 18, 2023
by
Justin
Browse files
Options
Browse Files
Download
Plain Diff
Added Node monitoring SR
See merge request
nexedi/slapos!1312
parents
533153ae
f4dbf136
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
488 additions
and
161 deletions
+488
-161
software/monitor/buildout.hash.cfg
software/monitor/buildout.hash.cfg
+6
-6
software/monitor/instance-default-input-schema.json
software/monitor/instance-default-input-schema.json
+145
-5
software/monitor/instance-default-output-schema.json
software/monitor/instance-default-output-schema.json
+99
-7
software/monitor/instance-edgetest-basic-output-schema.json
software/monitor/instance-edgetest-basic-output-schema.json
+11
-0
software/monitor/instance-monitor-edgetest-basic.cfg.jinja2
software/monitor/instance-monitor-edgetest-basic.cfg.jinja2
+37
-2
software/monitor/instance-monitor.cfg.jinja2
software/monitor/instance-monitor.cfg.jinja2
+0
-114
software/monitor/instance-node-monitoring.jinja2.cfg
software/monitor/instance-node-monitoring.jinja2.cfg
+107
-0
software/monitor/instance.cfg
software/monitor/instance.cfg
+12
-19
software/monitor/software.cfg
software/monitor/software.cfg
+20
-5
software/monitor/software.cfg.json
software/monitor/software.cfg.json
+2
-2
software/monitor/test/test.py
software/monitor/test/test.py
+38
-0
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+1
-1
software/slapos-testing/software.cfg
software/slapos-testing/software.cfg
+10
-0
No files found.
software/monitor/buildout.hash.cfg
View file @
429c0f3d
...
@@ -14,11 +14,7 @@
...
@@ -14,11 +14,7 @@
# not need these here).
# not need these here).
[template]
[template]
filename = instance.cfg
filename = instance.cfg
md5sum = 072b276e0b0dd4b4a96a50348a04c7a7
md5sum = e1dd16a6f50468959b5c4572b8c82f23
[template-monitor]
_update_hash_filename_ = instance-monitor.cfg.jinja2
md5sum = 5afba85a7aca9e716f61d59a524adc12
[json-test-template]
[json-test-template]
_update_hash_filename_ = json-test-template.json.in.jinja2
_update_hash_filename_ = json-test-template.json.in.jinja2
...
@@ -26,7 +22,11 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
...
@@ -26,7 +22,11 @@ md5sum = 2eb5596544d9c341acf653d4f7ce2680
[template-monitor-edgetest-basic]
[template-monitor-edgetest-basic]
_update_hash_filename_ = instance-monitor-edgetest-basic.cfg.jinja2
_update_hash_filename_ = instance-monitor-edgetest-basic.cfg.jinja2
md5sum = efc528296ddf7fade335d5f4241c1828
md5sum = 6b933beb0744d97c7760e4601298e137
[template-node-monitoring]
_update_hash_filename_ = instance-node-monitoring.jinja2.cfg
md5sum = 2d8bd1224472983e54f36770d3e3f969
[network-bench-cfg]
[network-bench-cfg]
filename = network_bench.cfg.in
filename = network_bench.cfg.in
...
...
software/monitor/instance-default-input-schema.json
View file @
429c0f3d
{
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"title"
:
"Input Parameters"
,
"type"
:
"object"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
"dummy"
:
{
"promise_cpu_temperature_frequency"
:
{
"title"
:
"dummy"
,
"default"
:
"2"
,
"description"
:
"Dummy"
,
"title"
:
"Frequency at which CPU temperature promise will be run (unit: minutes)"
,
"type"
:
"string"
"description"
:
"Frequency at which CPU temperature promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_cpu_temperature_threshold"
:
{
"default"
:
"90"
,
"title"
:
"CPU temperature promise threshold (unit: Celsius)"
,
"description"
:
"Temperature threshold above which CPU temperature promise will fail (unit: Celsius)"
,
"type"
:
"number"
},
"promise_cpu_avg_temperature_threshold"
:
{
"default"
:
"80"
,
"title"
:
"Average CPU temperature promise threshold (unit: Celsius)"
,
"description"
:
"If average temperature over specified duration reaches this threshold, promise will fail (unit: Celsius)"
,
"type"
:
"number"
},
"promise_cpu_avg_temperature_threshold_duration"
:
{
"default"
:
"600"
,
"title"
:
"Average CPU temperature promise threshold duration (unit: secondes)"
,
"description"
:
"Duration during which average temperature should not exceed specified threshold (unit: secondes)"
,
"type"
:
"number"
},
"promise_ram_available_frequency"
:
{
"default"
:
"2"
,
"title"
:
"Frequency at which RAM availalble promise will be run (unit: minutes)"
,
"description"
:
"Frequency at which RAM availalble promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_ram_available_threshold"
:
{
"default"
:
"500"
,
"title"
:
"Minimum available RAM promise threshold (unit: MB)"
,
"description"
:
"Minimum available RAM threshold below which RAM available promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_ram_avg_available_threshold"
:
{
"default"
:
"1e3"
,
"title"
:
"Minimum average available RAM promise threshold (unit: MB)"
,
"description"
:
"If average available ram over specified duration reaches this threshold, promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_ram_avg_available_threshold_duration"
:
{
"default"
:
"600"
,
"title"
:
"Minimum average available RAM promise threshold duration (unit: secondes)"
,
"description"
:
"Duration during which average available RAM shall not be below specified threshold (unit: secondes)"
,
"type"
:
"number"
},
"promise_network_errors_frequency"
:
{
"default"
:
"5"
,
"title"
:
"Frequency at which network errors promise will be run (unit: minutes)"
,
"description"
:
"Frequency at which network errors promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_network_errors_threshold"
:
{
"default"
:
"100"
,
"title"
:
"Maximum errors on Network per MB (unit: N/A)"
,
"description"
:
"Maximum network errors threshold(per MB) above which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_network_lost_packets_threshold"
:
{
"default"
:
"100"
,
"title"
:
"Maximum lost packets on Network per MB (unit: N/A)"
,
"description"
:
"Maximum network lost packets threshold(per MB) above which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_network_transit_frequency"
:
{
"default"
:
"1"
,
"title"
:
"Frequency at which network transit promise will be run (unit: minutes)"
,
"description"
:
"Frequency at which network transit promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_network_transit_max_data_threshold"
:
{
"default"
:
"1e6"
,
"title"
:
"Maximum data amount on network (unit: MB)"
,
"description"
:
"Maximum data amount on network below which the promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_network_transit_min_data_threshold"
:
{
"default"
:
"0"
,
"title"
:
"Minimum data amount on network (unit: MB)"
,
"description"
:
"Minimum data amount on network below which the promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_network_transit_duration"
:
{
"default"
:
"600"
,
"title"
:
"Duration to check thresholds (unit: secondes)"
,
"description"
:
"Duration during which data amount on network shall not be above maximum and below minimum (unit: secondes)"
,
"type"
:
"number"
},
"promise_cpu_load_frequency"
:
{
"default"
:
"3"
,
"title"
:
"Frequency at which CPU load promise will be run (unit: minutes)"
,
"description"
:
"Frequency at which CPU load promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_cpu_load_threshold"
:
{
"default"
:
"1.5"
,
"title"
:
"Maximum CPU load ratio threshold (unit: N/A)"
,
"description"
:
"Maximum CPU load ratio threshold above which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_monitor_space_frequency"
:
{
"default"
:
"60"
,
"title"
:
"Frequency at which monitor space promise will be run (unit: minutes)"
,
"description"
:
"Frequency at which monitor space promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_partition_space_threshold"
:
{
"default"
:
"0.08"
,
"title"
:
"Minimum partition space ratio threshold (unit: N/A)"
,
"description"
:
"Minimum partition space ratio threshold below which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_free_disk_space_frequency"
:
{
"default"
:
"60"
,
"title"
:
"Frequency at which free disk space promise will be run (unit: minutes)"
,
"description"
:
"Frequency at which free disk space promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_free_disk_space_threshold"
:
{
"default"
:
"0.08"
,
"title"
:
"Minimum partition space ratio threshold (unit: N/A)"
,
"description"
:
"Minimum partition space ratio threshold below which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_free_disk_space_nb_days_predicted"
:
{
"default"
:
"10"
,
"title"
:
"Number of days for prediction (unit: Days)"
,
"description"
:
"Number of days (unit: Days) that will be take into account for prediction calculation"
,
"type"
:
"number"
},
"promise_free_disk_space_display_partition"
:
{
"default"
:
true
,
"title"
:
"Boolean to display partition (unit: N/A)"
,
"description"
:
"Enable partition display by setting boolean to True (unit: N/A)"
,
"type"
:
"boolean"
},
"promise_free_disk_space_display_prediction"
:
{
"default"
:
true
,
"title"
:
"Boolean to display prediction (unit: N/A)"
,
"description"
:
"Enable prediction display by setting boolean to True (unit: N/A)"
,
"type"
:
"boolean"
}
}
}
}
}
}
software/monitor/instance-default-output-schema.json
View file @
429c0f3d
{
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"$schema"
:
"http://json-schema.org/draft-04/schema"
,
"description"
:
"Values returned by Re6st Master instanciation"
,
"title"
:
"Values returned by node-monitoring instanciation"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
"re6stry-url"
:
{
"promise_cpu_temperature_frequency"
:
{
"description"
:
"ipv6 url to access your re6st registry service"
,
"description"
:
"Frequency at which CPU temperature promise will be run (unit: minutes)"
,
"type"
:
"string"
"type"
:
"number"
}
},
"promise_cpu_temperature_threshold"
:
{
"description"
:
"Temperature threshold above which CPU temperature promise will fail (unit: Celsius)"
,
"type"
:
"number"
},
"promise_cpu_avg_temperature_threshold"
:
{
"description"
:
"If average temperature over specified duration reaches this threshold, promise will fail (unit: Celsius)"
,
"type"
:
"number"
},
"promise_cpu_avg_temperature_threshold_duration"
:
{
"description"
:
"Duration during which average temperature should not exceed specified threshold (unit: secondes)"
,
"type"
:
"number"
},
"promise_ram_available_frequency"
:
{
"description"
:
"Frequency at which RAM availalble promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_ram_available_threshold"
:
{
"description"
:
"Minimum available RAM threshold below which RAM available promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_ram_avg_available_threshold"
:
{
"description"
:
"If average available ram over specified duration reaches this threshold, promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_ram_avg_available_threshold_duration"
:
{
"description"
:
"Duration during which average available RAM shall not be below specified threshold (unit: secondes)"
,
"type"
:
"number"
},
"promise_network_errors_frequency"
:
{
"description"
:
"Frequency at which network errors promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_network_errors_threshold"
:
{
"description"
:
"Maximum network errors threshold(per MB) above which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_network_lost_packets_threshold"
:
{
"description"
:
"Maximum network lost packets threshold(per MB) above which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_network_transit_frequency"
:
{
"description"
:
"Frequency at which network transit promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_network_transit_max_data_threshold"
:
{
"description"
:
"Maximum data amount on network below which the promise will fail (unit: MB)"
,
"type"
:
"number"
},
},
"type"
:
"object"
"promise_network_transit_min_data_threshold"
:
{
"description"
:
"Minimum data amount on network below which the promise will fail (unit: MB)"
,
"type"
:
"number"
},
"promise_network_transit_duration"
:
{
"description"
:
"Duration during which data amount on network shall not be above maximum and below minimum (unit: secondes)"
,
"type"
:
"number"
},
"promise_cpu_load_frequency"
:
{
"description"
:
"Frequency at which CPU load promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_cpu_load_threshold"
:
{
"description"
:
"Maximum CPU load ratio threshold above which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_monitor_space_frequency"
:
{
"description"
:
"Frequency at which monitor space promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_partition_space_threshold"
:
{
"description"
:
"Minimum partition space ratio threshold below which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_free_disk_space_frequency"
:
{
"description"
:
"Frequency at which free disk space promise will be run (unit: minutes)"
,
"type"
:
"number"
},
"promise_free_disk_space_threshold"
:
{
"description"
:
"Minimum partition space ratio threshold below which the promise will fail (unit: N/A)"
,
"type"
:
"number"
},
"promise_free_disk_space_nb_days_predicted"
:
{
"description"
:
"Number of days (unit: Days) that will be take into account for prediction calculation"
,
"type"
:
"number"
},
"promise_free_disk_space_display_partition"
:
{
"description"
:
"Enable partition display by setting boolean to True (unit: N/A)"
,
"type"
:
"boolean"
},
"promise_free_disk_space_display_prediction"
:
{
"description"
:
"Enable prediction display by setting boolean to True (unit: N/A)"
,
"type"
:
"boolean"
}
}
}
}
software/monitor/instance-edgetest-basic-output-schema.json
0 → 100644
View file @
429c0f3d
{
"$schema"
:
"http://json-schema.org/draft-04/schema#"
,
"description"
:
"Values returned by Re6st Master instanciation"
,
"properties"
:
{
"re6stry-url"
:
{
"description"
:
"ipv6 url to access your re6st registry service"
,
"type"
:
"string"
}
},
"type"
:
"object"
}
software/monitor/instance-monitor-edgetest-basic.cfg.jinja2
View file @
429c0f3d
...
@@ -135,8 +135,43 @@ command = ${surykatka-status-json-{{ class }}:output}
...
@@ -135,8 +135,43 @@ command = ${surykatka-status-json-{{ class }}:output}
{%- endfor %} {#- for class, class_check_list in CHECK_DICT.items() #}
{%- endfor %} {#- for class, class_check_list in CHECK_DICT.items() #}
[buildout]
[buildout]
extends = {{ instance_base_monitor }}
extends = {{ monitor_template }}
parts +=
parts =
publish-connection-information
{% for part_id in sorted(PART_LIST) %}
{% for part_id in sorted(PART_LIST) %}
{{ part_id }}
{{ part_id }}
{% endfor %}
{% endfor %}
[publish-connection-information]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
server_log_url = ${monitor-publish-parameters:monitor-base-url}/${slap-configuration:private-hash}/
[monitor-directory]
service = ${buildout:directory}/etc/service
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
server-log = ${:private}/server-log
monitor-log = ${:private}/monitor-log
system-log = ${:private}/system-log
consumption = ${:log}/consumption
[pwgen]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[pwgen32]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
private-hash = ${pwgen:passwd}${pwgen32:passwd}
frontend-domain =
software/monitor/instance-monitor.cfg.jinja2
deleted
100644 → 0
View file @
533153ae
[buildout]
extends = {{ monitor_template_output }}
parts =
cron
cron-network-bench
symlink-re6st-logs
symlink-collected-logs
python-symlink
monitor-collect-csv-wrapper
monitor-base
monitor-check-memory-usage
monitor-check-cpu-usage
publish-connection-information
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[cron-network-bench]
<= cron
recipe = slapos.cookbook:cron.d
name = network-bench-test
frequency = */10 * * * *
# skip to not fill cron log file.
# command = {{ buildout_bin }}/networkbench ${network-bench-configuration:output} ${monitor-directory:monitor-log}
command = true
[symlink-re6st-logs]
recipe = cns.recipe.symlink
symlink = /var/log/re6stnet = ${monitor-directory:system-log}/re6stnet
autocreate = true
[symlink-collected-logs]
recipe = cns.recipe.symlink
symlink = /srv/slapgrid/var/data-log = ${monitor-directory:server-log}/data-log
autocreate = true
[network-bench-configuration]
recipe = slapos.recipe.template:jinja2
url = {{ network_benck_cfg_output }}
output = ${monitor-directory:etc}/network_bench.cfg
context =
key slapparameter_dict slap-configuration:configuration
[pwgen]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[pwgen32]
recipe = slapos.cookbook:generate.password
user = admin
bytes = 16
[monitor-instance-parameter]
monitor-httpd-port = {{ slap_configuration['configuration.monitor-base-port'] }}
[monitor-directory]
service = ${buildout:directory}/etc/service
var = ${buildout:directory}/var
srv = ${buildout:directory}/srv
server-log = ${:private}/server-log
monitor-log = ${:private}/monitor-log
system-log = ${:private}/system-log
consumption = ${:log}/consumption
[python-symlink]
recipe = plone.recipe.command
command = ln -sf {{ buildout_bin }}/pythonwitheggs ${monitor-directory:bin}/python
update-command = ${:command}
[monitor-collect-csv-wrapper]
recipe = slapos.cookbook:wrapper
command-line =
${monitor-directory:bin}/python {{ monitor_collect_csv_dump }} --output_folder ${monitor-directory:consumption}
wrapper-path = ${monitor-directory:bin}/monitor-collect-csv-dump
[monitor-check-memory-usage]
<= monitor-promise-base
promise = check_command_execute
name = check-computer-memory-usage.py
config-command = {{ buildout_bin}}/check-computer-memory -db ${monitor-instance-parameter:collector-db} --threshold ${slap-parameter:memory-percent-threshold} --unit percent
[monitor-check-cpu-usage]
recipe = slapos.cookbook:promise.plugin
eggs =
slapos.toolbox
module = slapos.promise.plugin.check_server_cpu_load
output = ${directory:plugins}/system-CPU-load-check.py
config-cpu-load-threshold = ${slap-parameter:cpu-load-threshold}
[publish-connection-information]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
server_log_url = ${monitor-publish-parameters:monitor-base-url}/${slap-configuration:private-hash}/
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
private-hash = ${pwgen:passwd}${pwgen32:passwd}
frontend-domain =
[slap-parameter]
# Max cpu load for one core on server
cpu-load-threshold = 3.0
memory-percent-threshold = 96
software/monitor/instance-node-monitoring.jinja2.cfg
0 → 100644
View file @
429c0f3d
[buildout]
parts =
directory
check-disk-space.py
check-partition-space.py
check-cpu-temperature.py
check-ram-usage.py
check-network-errors.py
check-network-transit.py
check-cpu-load.py
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = {{ slap_connection['computer-id'] }}
partition = {{ slap_connection['partition-id'] }}
url = {{ slap_connection['server-url'] }}
key = {{ slap_connection['key-file'] }}
cert = {{ slap_connection['cert-file'] }}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
<= monitor-publish
[macro.promise]
<= monitor-promise-base
name = ${:_buildout_section_name_}
[check-disk-space.py]
<= macro.promise
eggs = slapos.toolbox[prediction]
promise = check_free_disk_space
config-collectordb = ${monitor-instance-parameter:collector-db}
config-frequency = {{ slapparameter_dict.get("promise_free_disk_space_frequency", 60) }}
config-threshold = {{ slapparameter_dict.get("promise_free_disk_space_threshold", 0.08) }}
config-nb-days-predicted = {{ slapparameter_dict.get("promise_free_disk_space_nb_days_predicted", 10) }}
config-display-partition = {{ int(slapparameter_dict.get("promise_free_disk_space_display_partition", 1)) }}
config-display-prediction = {{ int(slapparameter_dict.get("promise_free_disk_space_display_prediction", 1)) }}
[check-partition-space.py]
<= macro.promise
eggs = slapos.toolbox[pandas]
promise = monitor_partition_space
config-collectordb = ${monitor-instance-parameter:collector-db}
config-frequency = {{ slapparameter_dict.get("promise_monitor_space_frequency", 60) }}
config-threshold-ratio = {{ slapparameter_dict.get("promise_partition_space_threshold", 0.08) }}
[check-cpu-temperature.py]
<= macro.promise
promise = check_cpu_temperature
config-testing = false
config-frequency = {{ slapparameter_dict.get("promise_cpu_temperature_frequency", 5) }}
config-max-spot-temp = {{ slapparameter_dict.get("promise_cpu_temperature_threshold", 90) }}
config-max-avg-temp = {{ slapparameter_dict.get("promise_cpu_avg_temperature_threshold", 80) }}
config-avg-temp-duration = {{ slapparameter_dict.get("promise_cpu_avg_temperature_threshold_duration", 600) }}
config-last-avg-computation-file = ${directory:var}/promise_cpu_temperature_last_avg_file
[check-ram-usage.py]
<= macro.promise
promise = check_ram_usage
config-frequency = {{ slapparameter_dict.get("promise_ram_available_frequency", 2) }}
config-min-threshold-ram = {{ slapparameter_dict.get("promise_ram_available_threshold", 500) }}
config-min-avg-ram = {{ slapparameter_dict.get("promise_ram_avg_available_threshold", 1e3) }}
config-avg-ram-period = {{ slapparameter_dict.get("promise_ram_avg_available_threshold_duration", 600) }}
config-last-avg-ram-file = ${directory:var}/promise_ram_space_last_avg_file
[check-network-errors.py]
<= macro.promise
promise = check_network_errors_packets
config-frequency = {{ slapparameter_dict.get("promise_network_errors_frequency", 5) }}
config-max-error-messages-per-MB = {{ slapparameter_dict.get("promise_network_errors_threshold", 100) }}
config-max-lost-packets-per-MB = {{ slapparameter_dict.get("promise_network_lost_packets_threshold", 100) }}
[check-network-transit.py]
<= macro.promise
promise = check_network_transit
config-frequency = {{ slapparameter_dict.get("promise_network_transit_frequency", 5) }}
config-max-data-amount = {{ slapparameter_dict.get("promise_network_transit_max_data_threshold", 1e6) }}
config-min-data-amount = {{ slapparameter_dict.get("promise_network_transit_min_data_threshold", 0) }}
config-transit-period = {{ slapparameter_dict.get("promise_network_transit_duration", 600) }}
config-last-transit-file = ${directory:var}/promise_network_last_transit_file
[check-cpu-load.py]
<= macro.promise
promise = check_server_cpu_load
config-frequency = {{ slapparameter_dict.get("promise_cpu_load_frequency", 3) }}
config-cpu-load-threshold = {{ slapparameter_dict.get("promise_cpu_load_threshold", 1.5) }}
software/monitor/instance.cfg
View file @
429c0f3d
...
@@ -7,24 +7,10 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
...
@@ -7,24 +7,10 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[switch_softwaretype]
[switch_softwaretype]
recipe = slapos.cookbook:switch-softwaretype
recipe = slapos.cookbook:switch-softwaretype
default = instance-
base-monitor
:output
default = instance-
node-monitoring
:output
edgetest-basic = instance-edgetest-basic:output
edgetest-basic = instance-edgetest-basic:output
RootSoftwareInstance = $${:default}
RootSoftwareInstance = $${:default}
[instance-base-monitor]
recipe = slapos.recipe.template:jinja2
url = ${template-monitor:target}
output = $${buildout:directory}/template-base-monitor.cfg
extensions = jinja2.ext.do
context = key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
section slap_configuration slap-configuration
raw buildout_bin ${buildout:bin-directory}
raw monitor_template_output ${monitor-template:output}
raw network_benck_cfg_output ${network-bench-cfg:output}
raw monitor_collect_csv_dump ${monitor-collect-csv-dump:target}
[instance-template]
[instance-template]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
extensions = jinja2.ext.do
...
@@ -36,13 +22,16 @@ context =
...
@@ -36,13 +22,16 @@ context =
key eggs_directory buildout:eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
key slapparameter_dict slap-configuration:configuration
key slap_software_type slap-configuration:slap-software-type
key slap_software_type slap-configuration:slap-software-type
key instance_base_monitor instance-base-monitor:output
raw buildout_bin ${buildout:bin-directory}
raw buildout_bin ${buildout:bin-directory}
raw monitor_template ${monitor2-template:output}
$${:extra-context}
$${:extra-context}
[surykatka]
[instance-node-monitoring]
binary = ${buildout:bin-directory}/${surykatka:script-name}
<= instance-template
ini = ${template-surykatka-ini:target}
url = ${template-node-monitoring:target}
extra-context =
raw buildout_directory ${buildout:directory}
section slap_connection slap-connection
[instance-edgetest-basic]
[instance-edgetest-basic]
<= instance-template
<= instance-template
...
@@ -52,6 +41,10 @@ extra-context =
...
@@ -52,6 +41,10 @@ extra-context =
key template_surykatka_ini surykatka:ini
key template_surykatka_ini surykatka:ini
key surykatka_binary surykatka:binary
key surykatka_binary surykatka:binary
[surykatka]
binary = ${buildout:bin-directory}/${surykatka:script-name}
ini = ${template-surykatka-ini:target}
[slap-configuration]
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id}
computer = $${slap-connection:computer-id}
...
...
software/monitor/software.cfg
View file @
429c0f3d
...
@@ -4,31 +4,35 @@ extends =
...
@@ -4,31 +4,35 @@ extends =
buildout.hash.cfg
buildout.hash.cfg
../../component/pycurl/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../component/python3/buildout.cfg
../../component/pandas/buildout.cfg
../../component/scipy/buildout.cfg
../../component/statsmodels/buildout.cfg
../../component/defaults.cfg
../../stack/monitor/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
../../stack/slapos.cfg
../../component/python3/buildout.cfg
parts =
parts =
slapos-cookbook
slapos-cookbook
network-bench-cfg
network-bench-cfg
json-test-template
json-test-template
template
template
template-monitor
[template]
[template]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
output = ${buildout:directory}/template.cfg
[template-monitor]
[template-monitor
-edgetest-basic
]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template-
monitor-edgetest-basic
]
[template-
surykatka-ini
]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
url = ${:_profile_base_location_}/${:_update_hash_filename_}
[template-
surykatka-ini
]
[template-
node-monitoring
]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
url = ${:_profile_base_location_}/${:_update_hash_filename_}
...
@@ -68,3 +72,14 @@ miniupnpc = 2.0.2
...
@@ -68,3 +72,14 @@ miniupnpc = 2.0.2
peewee = 3.14.4
peewee = 3.14.4
python-whois = 0.7.3
python-whois = 0.7.3
future = 0.18.2
future = 0.18.2
# Build GCC with Fortran for OpenBLAS (scipy & numpy)
[gcc]
max_version = 0
[slapos-toolbox-dependencies]
eggs +=
${pandas:egg}
${statsmodels:egg}
${scipy:egg}
software/monitor/software.cfg.json
View file @
429c0f3d
{
{
"name"
:
"Monitor"
,
"name"
:
"Monitor"
,
"description"
:
"Software release for Monitoring purpose"
,
"description"
:
"Software release for Monitoring purpose"
,
"serialisation"
:
"xml"
,
"serialisation"
:
"
json-in-
xml"
,
"software-type"
:
{
"software-type"
:
{
"default"
:
{
"default"
:
{
"title"
:
"Default"
,
"title"
:
"Default"
,
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
"title"
:
"Edge Test Basic"
,
"title"
:
"Edge Test Basic"
,
"description"
:
"Basic URL monitoring configuration"
,
"description"
:
"Basic URL monitoring configuration"
,
"request"
:
"instance-edgetest-basic-input-schema.json"
,
"request"
:
"instance-edgetest-basic-input-schema.json"
,
"response"
:
"instance-
default
-output-schema.json"
,
"response"
:
"instance-
edgetest-basic
-output-schema.json"
,
"serialisation"
:
"json-in-xml"
,
"serialisation"
:
"json-in-xml"
,
"index"
:
1
"index"
:
1
}
}
...
...
software/monitor/test/test.py
View file @
429c0f3d
...
@@ -533,3 +533,41 @@ URL =
...
@@ -533,3 +533,41 @@ URL =
self
.
assertSurykatkaPromises
()
self
.
assertSurykatkaPromises
()
self
.
assertSurykatkaCron
()
self
.
assertSurykatkaCron
()
self
.
assertConnectionParameterDict
()
self
.
assertConnectionParameterDict
()
class
TestNodeMonitoring
(
SlapOSInstanceTestCase
):
"""Test class for node monitoring instanciation"""
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'_'
:
json
.
dumps
({
'promise_cpu_temperature_frequency'
:
2
,
'promise_cpu_temperature_threshold'
:
90
,
'promise_cpu_avg_temperature_threshold'
:
80
,
'promise_cpu_avg_temperature_threshold_duration'
:
600
,
'promise_ram_available_frequency'
:
2
,
'promise_ram_available_threshold'
:
500
,
'promise_ram_avg_available_threshold'
:
1e3
,
'promise_ram_avg_available_threshold_duration'
:
600
,
'promise_network_errors_frequency'
:
5
,
'promise_network_errors_threshold'
:
100
,
'promise_network_lost_packets_threshold'
:
100
,
'promise_network_transit_frequency'
:
1
,
'promise_network_transit_max_data_threshold'
:
1e6
,
'promise_network_transit_min_data_threshold'
:
0
,
'promise_network_transit_duration'
:
600
,
'promise_cpu_load_threshold'
:
1.5
,
'promise_monitor_space_frequency'
:
5
,
'promise_partition_space_threshold'
:
0.08
,
'promise_free_disk_space_frequency'
:
3
,
'promise_free_disk_space_threshold'
:
0.08
,
'promise_free_disk_space_nb_days_predicted'
:
10
,
'promise_free_disk_space_display_partition'
:
True
,
'promise_free_disk_space_display_prediction'
:
True
,
})}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
'default'
def
test_node_monitoring_instance
(
self
):
pass
software/slapos-sr-testing/software.cfg
View file @
429c0f3d
software/slapos-testing/software.cfg
View file @
429c0f3d
...
@@ -24,6 +24,9 @@ extends =
...
@@ -24,6 +24,9 @@ extends =
../../component/openvpn/buildout.cfg
../../component/openvpn/buildout.cfg
../../component/babeld/buildout.cfg
../../component/babeld/buildout.cfg
../../component/bridge-utils/buildout.cfg
../../component/bridge-utils/buildout.cfg
../../component/pandas/buildout.cfg
../../component/statsmodels/buildout.cfg
../../component/scipy/buildout.cfg
../../stack/slapos.cfg
../../stack/slapos.cfg
../../stack/caucase/buildout.cfg
../../stack/caucase/buildout.cfg
../../stack/nxdtest.cfg
../../stack/nxdtest.cfg
...
@@ -35,6 +38,10 @@ parts =
...
@@ -35,6 +38,10 @@ parts =
phantomjs
phantomjs
template
template
[gcc]
# Always build GCC for Fortran (see openblas).
max_version = 0
[bootstrap-slapos.recipe.cmmi]
[bootstrap-slapos.recipe.cmmi]
# install our develop version of slapos.recipe.cmmi before anything else,
# install our develop version of slapos.recipe.cmmi before anything else,
# otherwise it will be installed from pypi by dependencies.
# otherwise it will be installed from pypi by dependencies.
...
@@ -153,6 +160,9 @@ eggs +=
...
@@ -153,6 +160,9 @@ eggs +=
${slapcache-setup:egg}
${slapcache-setup:egg}
${slapos.rebootstrap-setup:egg}
${slapos.rebootstrap-setup:egg}
${rubygemsrecipe-setup:egg}
${rubygemsrecipe-setup:egg}
${pandas:egg}
${statsmodels:egg}
${scipy:egg}
zope.testing
zope.testing
supervisor
supervisor
${extra-eggs:eggs}
${extra-eggs:eggs}
...
...
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