Commit 8b116dd9 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Alain Takoudjou

Add check computer memory promise to all erp5 instances

/reviewed-on !406
parent f047919f
...@@ -623,6 +623,7 @@ scripts += ...@@ -623,6 +623,7 @@ scripts +=
is-process-older-than-dependency-set is-process-older-than-dependency-set
check-slow-queries-digest-result check-slow-queries-digest-result
check-apachedex-result check-apachedex-result
check-computer-memory
runApacheDex runApacheDex
zodbpack zodbpack
......
...@@ -26,11 +26,11 @@ md5sum = 1af531c51f575a1d1362f2ca2d61620d ...@@ -26,11 +26,11 @@ md5sum = 1af531c51f575a1d1362f2ca2d61620d
[template-mariadb] [template-mariadb]
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 14ed6a85e086d52d4f4a553dda570f64 md5sum = f59c9c313147e437637c2c5ef00438d0
[template-kumofs] [template-kumofs]
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = 091d3c3feb2d543d176b0fadb11c07dc md5sum = fe6ae121134a0e5bdb060073478be44e
[template-zope-conf] [template-zope-conf]
filename = zope.conf.in filename = zope.conf.in
...@@ -50,7 +50,7 @@ md5sum = dec33a617fa1b307c8ddb883efcfe3ce ...@@ -50,7 +50,7 @@ md5sum = dec33a617fa1b307c8ddb883efcfe3ce
[template-postfix] [template-postfix]
filename = instance-postfix.cfg.in filename = instance-postfix.cfg.in
md5sum = f6d9ae099ac0f01ce45f80a452a4d203 md5sum = 0d4938bc36c3829646d6f93fced9a3e0
[template-postfix-master-cf] [template-postfix-master-cf]
filename = postfix_master.cf.in filename = postfix_master.cf.in
...@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0 ...@@ -66,7 +66,7 @@ md5sum = 0969fbb25b05c02ef3c2d437b2f4e1a0
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = a5e8278067899081239d4366cf2b9eae md5sum = be1466bfce26211e1f0b9e5cee47fe44
[monitor-template-dummy] [monitor-template-dummy]
filename = dummy.cfg filename = dummy.cfg
...@@ -74,19 +74,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e ...@@ -74,19 +74,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 64fd49395de02e6c2107afd1dd9cbdc9 md5sum = 83e69244728a0d323f535dd3e8b734b6
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = 3e650915959ff31c9c13c84069bbcd35 md5sum = d8f70f5826315a402bf6d72744b80bd9
[template-zope] [template-zope]
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = 408c8f358935d3167448ea3732adc994 md5sum = d1257e7e942307be0a79e34aa4320e9f
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = dccdf2a8cbfa57e49fa04be9ba4ff595 md5sum = f0fd49c7d6d9f7c6936afba0d18b7691
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
......
...@@ -337,6 +337,11 @@ recipe = slapos.cookbook:wrapper ...@@ -337,6 +337,11 @@ recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/check-apachedex-result wrapper-path = ${directory:promise}/check-apachedex-result
command-line = "{{ parameter_dict['promise-check-apachedex-result'] }}" --apachedex_path "${directory:apachedex}" --status_file ${monitor-directory:private}/apachedex.report.json --threshold "${apachedex-parameters:promise-threshold}" command-line = "{{ parameter_dict['promise-check-apachedex-result'] }}" --apachedex_path "${directory:apachedex}" --status_file ${monitor-directory:private}/apachedex.report.json --threshold "${apachedex-parameters:promise-threshold}"
[{{ section('promise-check-computer-memory') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/check-computer-memory
command-line = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${monitor-instance-parameter:collector-db} --threshold "{{ slapparameter_dict["computer-memory-percent-threshold"] }}" --unit percent
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ next_port() }} monitor-httpd-port = {{ next_port() }}
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
[request-common] [request-common]
<= request-common-base <= request-common-base
config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }} config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
config-computer-memory-percent-threshold = {{ dumps(monitor_dict.get('computer-memory-percent-threshold', 80)) }}
{% macro request(name, software_type, config_key, config, ret={'url': True}, key_config={}) -%} {% macro request(name, software_type, config_key, config, ret={'url': True}, key_config={}) -%}
{% do config.update(slapparameter_dict.get(config_key, {})) -%} {% do config.update(slapparameter_dict.get(config_key, {})) -%}
......
...@@ -12,6 +12,7 @@ parts += ...@@ -12,6 +12,7 @@ parts +=
promise-kumofs-server-listen promise-kumofs-server-listen
promise-kumofs-gateway promise-kumofs-gateway
promise-kumofs-manager promise-kumofs-manager
promise-check-computer-memory
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
...@@ -109,6 +110,11 @@ port = ${kumofs-instance:gateway-port} ...@@ -109,6 +110,11 @@ port = ${kumofs-instance:gateway-port}
path = ${directory:promise}/kumofs-manager path = ${directory:promise}/kumofs-manager
port = ${kumofs-instance:manager-port} port = ${kumofs-instance:manager-port}
[promise-check-computer-memory]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/check-computer-memory
command-line = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${monitor-instance-parameter:collector-db} --threshold "{{ slapparameter_dict["computer-memory-percent-threshold"] }}" --unit percent
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }} monitor-httpd-ipv6 = {{ (ipv6_set | list)[0] }}
monitor-httpd-port = {{ tcpv4_port + 4 }} monitor-httpd-port = {{ tcpv4_port + 4 }}
......
...@@ -337,6 +337,10 @@ recipe = slapos.cookbook:wrapper ...@@ -337,6 +337,10 @@ recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/check-slow-query-pt-digest-result wrapper-path = ${directory:promise}/check-slow-query-pt-digest-result
command-line = "{{ parameter_dict['promise-check-slow-queries-digest-result'] }}" --ptdigest_path "${directory:slowquery}" --status_file ${monitor-directory:private}/mariadb_slow_query.report.json --max_queries_threshold "${slow-query-digest-parameters:max_queries_threshold}" --slowest_query_threshold "${slow-query-digest-parameters:slowest_queries_threshold}" command-line = "{{ parameter_dict['promise-check-slow-queries-digest-result'] }}" --ptdigest_path "${directory:slowquery}" --status_file ${monitor-directory:private}/mariadb_slow_query.report.json --max_queries_threshold "${slow-query-digest-parameters:max_queries_threshold}" --slowest_query_threshold "${slow-query-digest-parameters:slowest_queries_threshold}"
[{{ section('promise-check-computer-memory') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/check-computer-memory
command-line = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${monitor-instance-parameter:collector-db} --threshold "{{ slapparameter_dict["computer-memory-percent-threshold"] }}" --unit percent
[{{ section('promise') }}] [{{ section('promise') }}]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
......
...@@ -255,6 +255,11 @@ path = ${directory:promise}/postfix ...@@ -255,6 +255,11 @@ path = ${directory:promise}/postfix
hostname = {{ ip }} hostname = {{ ip }}
port = {{ tcpv4_port }} port = {{ tcpv4_port }}
[{{ section('promise-check-computer-memory') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promise}/check-computer-memory
command-line = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${monitor-instance-parameter:collector-db} --threshold "{{ slapparameter_dict["computer-memory-percent-threshold"] }}" --unit percent
[buildout] [buildout]
extends = {{ logrotate_cfg }} extends = {{ logrotate_cfg }}
parts = parts =
......
...@@ -158,6 +158,11 @@ mode = 755 ...@@ -158,6 +158,11 @@ mode = 755
{% endif -%} {% endif -%}
[{{ section('promise-check-computer-memory') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promises}/check-computer-memory
command-line = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${monitor-instance-parameter:collector-db} --threshold "{{ slapparameter_dict["computer-memory-percent-threshold"] }}" --unit percent
[publish] [publish]
recipe = slapos.cookbook:publish.serialised recipe = slapos.cookbook:publish.serialised
storage-dict = {{ dumps(storage_dict) }} storage-dict = {{ dumps(storage_dict) }}
......
...@@ -500,6 +500,10 @@ expected-value = ...@@ -500,6 +500,10 @@ expected-value =
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
[{{ section('promise-check-computer-memory') }}]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:promises}/check-computer-memory
command-line = "{{ parameter_dict["check-computer-memory-binary"] }}" -db ${monitor-instance-parameter:collector-db} --threshold "{{ slapparameter_dict["computer-memory-percent-threshold"] }}" --unit percent
[publish] [publish]
......
...@@ -6,9 +6,13 @@ extends = ...@@ -6,9 +6,13 @@ extends =
[jinja2-template-base] [jinja2-template-base]
mode = 644 mode = 644
[dynamic-template-postfix-parameters] [default-dynamic-template-parameters]
bin-directory = {{ bin_directory }} bin-directory = {{ bin_directory }}
buildout-bin-directory = {{ buildout_bin_directory }} buildout-bin-directory = {{ buildout_bin_directory }}
check-computer-memory-binary = {{ bin_directory }}/check-computer-memory
[dynamic-template-postfix-parameters]
<= default-dynamic-template-parameters
cyrus-sasl-location = {{ cyrus_sasl_location }} cyrus-sasl-location = {{ cyrus_sasl_location }}
openssl = {{ openssl_location }} openssl = {{ openssl_location }}
postfix-location = {{ postfix_location }} postfix-location = {{ postfix_location }}
...@@ -48,10 +52,10 @@ import-list = ...@@ -48,10 +52,10 @@ import-list =
openssl-location = {{ openssl_location }} openssl-location = {{ openssl_location }}
[dynamic-template-balancer-parameters] [dynamic-template-balancer-parameters]
<= default-dynamic-template-parameters
apache = {{ apache_location }} apache = {{ apache_location }}
openssl = {{ openssl_location }} openssl = {{ openssl_location }}
haproxy = {{ haproxy_location }} haproxy = {{ haproxy_location }}
bin-directory = {{ bin_directory }}
apachedex-location = {{ bin_directory }}/apachedex apachedex-location = {{ bin_directory }}/apachedex
run-apachedex-location = {{ bin_directory }}/runApacheDex run-apachedex-location = {{ bin_directory }}/runApacheDex
promise-check-apachedex-result = {{ bin_directory }}/check-apachedex-result promise-check-apachedex-result = {{ bin_directory }}/check-apachedex-result
...@@ -68,7 +72,7 @@ extra-context = ...@@ -68,7 +72,7 @@ extra-context =
import itertools itertools import itertools itertools
[dynamic-template-zeo-parameters] [dynamic-template-zeo-parameters]
buildout-bin-directory = {{ buildout_bin_directory }} <= default-dynamic-template-parameters
template-monitor = {{ dumps(template_monitor) }} template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-zeo] [dynamic-template-zeo]
...@@ -82,10 +86,9 @@ extra-context = ...@@ -82,10 +86,9 @@ extra-context =
import itertools itertools import itertools itertools
[dynamic-template-zope-parameters] [dynamic-template-zope-parameters]
bin-directory = {{ bin_directory }} <= default-dynamic-template-parameters
zope-conf-template = {{ template_zope_conf }} zope-conf-template = {{ template_zope_conf }}
run-zelenium-template = {{ template_run_zelenium }} run-zelenium-template = {{ template_run_zelenium }}
buildout-bin-directory = {{ buildout_bin_directory }}
6tunnel = {{ sixtunnel_location }} 6tunnel = {{ sixtunnel_location }}
coreutils = {{ coreutils_location }} coreutils = {{ coreutils_location }}
dash = {{ dash_location }} dash = {{ dash_location }}
...@@ -111,6 +114,7 @@ extra-context = ...@@ -111,6 +114,7 @@ extra-context =
import itertools itertools import itertools itertools
[dynamic-template-kumofs-parameters] [dynamic-template-kumofs-parameters]
<= default-dynamic-template-parameters
dash-location = {{ dash_location }} dash-location = {{ dash_location }}
dcron-location = {{ dcron_location }} dcron-location = {{ dcron_location }}
gzip-location = {{ gzip_location }} gzip-location = {{ gzip_location }}
...@@ -126,6 +130,7 @@ extra-context = ...@@ -126,6 +130,7 @@ extra-context =
section parameter_dict dynamic-template-kumofs-parameters section parameter_dict dynamic-template-kumofs-parameters
[dynamic-template-mariadb-parameters] [dynamic-template-mariadb-parameters]
<= default-dynamic-template-parameters
bash = {{ bash_location }} bash = {{ bash_location }}
coreutils-location = {{ coreutils_location }} coreutils-location = {{ coreutils_location }}
dash-location = {{ dash_location }} dash-location = {{ dash_location }}
...@@ -135,7 +140,6 @@ mariadb-location = {{ mariadb_location }} ...@@ -135,7 +140,6 @@ mariadb-location = {{ mariadb_location }}
template-my-cnf = {{ template_my_cnf }} template-my-cnf = {{ template_my_cnf }}
template-mariadb-initial-setup = {{ template_mariadb_initial_setup }} template-mariadb-initial-setup = {{ template_mariadb_initial_setup }}
link-binary = {{ dumps(mariadb_link_binary) }} link-binary = {{ dumps(mariadb_link_binary) }}
bin-directory = {{ bin_directory }}
mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }} mariadb-resiliency-after-import-script = {{ mariadb_resiliency_after_import_script }}
mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }} mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }}
mariadb-start-clone-from-backup = {{ mariadb_start_clone_from_backup }} mariadb-start-clone-from-backup = {{ mariadb_start_clone_from_backup }}
......
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