Commit 6a29eef6 authored by Julien Muchembled's avatar Julien Muchembled Committed by Matevz Golob

Some clean-up in the monitor stack and its use in ERP5

We'll add monitoring to NEO so some parts are also moved there from ERP5.
parent fa8d8cc6
...@@ -22,6 +22,7 @@ context = ...@@ -22,6 +22,7 @@ context =
key ipv6_set slap-configuration:ipv6 key ipv6_set slap-configuration:ipv6
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
raw logrotate_cfg {{ template_logrotate_base }} raw logrotate_cfg {{ template_logrotate_base }}
raw template_monitor {{ template_monitor }}
raw bin_directory {{ bin_directory }} raw bin_directory {{ bin_directory }}
${:extra-context} ${:extra-context}
......
...@@ -27,6 +27,7 @@ computer-id = ${slap-connection:computer-id} ...@@ -27,6 +27,7 @@ computer-id = ${slap-connection:computer-id}
partition-id = ${slap-connection:partition-id} partition-id = ${slap-connection:partition-id}
[buildout] [buildout]
extends = {{ template_monitor }}
parts = parts =
publish publish
{{ part_list | join('\n\t') }} {{ part_list | join('\n\t') }}
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
extends = extends =
../../stack/slapos.cfg ../../stack/slapos.cfg
../../stack/logrotate/buildout.cfg ../../stack/logrotate/buildout.cfg
../../stack/monitor/buildout.cfg
../../component/cython-zstd/buildout.cfg ../../component/cython-zstd/buildout.cfg
#LXML #LXML
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
...@@ -93,7 +94,7 @@ mode = 644 ...@@ -93,7 +94,7 @@ mode = 644
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in template = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in
rendered = ${buildout:directory}/${:_buildout_section_name_}.cfg rendered = ${buildout:directory}/${:_buildout_section_name_}.cfg
md5sum = b867ba222a436807954f732642fb116d md5sum = c0e22816537b56bceef0b4c2b40f6219
context = context =
key bin_directory buildout:bin-directory key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
...@@ -102,6 +103,7 @@ context = ...@@ -102,6 +103,7 @@ context =
key neo_master instance-neo-master:target key neo_master instance-neo-master:target
key neo instance-neo:target key neo instance-neo:target
key template_logrotate_base template-logrotate-base:rendered key template_logrotate_base template-logrotate-base:rendered
key template_monitor monitor2-template:rendered
${:adapter-context} ${:adapter-context}
adapter-context = adapter-context =
key mariadb_location mariadb:location key mariadb_location mariadb:location
...@@ -109,7 +111,7 @@ adapter-context = ...@@ -109,7 +111,7 @@ adapter-context =
[root-common] [root-common]
<= download-base-neo <= download-base-neo
md5sum = f3259726bd5d824c569dc7db6b7d26a0 md5sum = 66055aa82f9097c5301864c07e6e5d80
[instance-neo-admin] [instance-neo-admin]
<= download-base-neo <= download-base-neo
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
# not need these here). # not need these here).
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = c4941a1c862474b71fd7255feb830299 md5sum = 0c929dcaba31e024d94c63c4aee181d6
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 1a6a00153441d6a8e7ff9d27039e541e md5sum = b7504fcbd8eaecb91709abbcb5bcabe8
[template-apache-backend-conf] [template-apache-backend-conf]
filename = apache-backend.conf.in filename = apache-backend.conf.in
......
...@@ -289,7 +289,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }} ...@@ -289,7 +289,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
...@@ -290,7 +290,7 @@ certs = ${:ca-dir}/certs ...@@ -290,7 +290,7 @@ certs = ${:ca-dir}/certs
newcerts = ${:ca-dir}/newcerts newcerts = ${:ca-dir}/newcerts
crl = ${:ca-dir}/crl crl = ${:ca-dir}/crl
[apache-certificate-authority] [{{root_common.section('apache-certificate-authority')}}]
recipe = slapos.cookbook:certificate_authority recipe = slapos.cookbook:certificate_authority
openssl-binary = {{ openssl_location }}/bin/openssl openssl-binary = {{ openssl_location }}/bin/openssl
ca-dir = ${directory:ca-dir} ca-dir = ${directory:ca-dir}
...@@ -308,7 +308,7 @@ company = {{ dumps(slapparameter_dict.get('company', 'Compagny')) }} ...@@ -308,7 +308,7 @@ company = {{ dumps(slapparameter_dict.get('company', 'Compagny')) }}
# XXX - Big hack: Change access for certificate authority configuration # XXX - Big hack: Change access for certificate authority configuration
# To allow apache to read openssl.cnf in this folder # To allow apache to read openssl.cnf in this folder
[fix-ca-folder] [{{root_common.section('fix-ca-folder')}}]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
command = command =
...@@ -457,14 +457,6 @@ monitor-httpd-port = 8386 ...@@ -457,14 +457,6 @@ monitor-httpd-port = 8386
{{ root_common.common_section() }} {{ root_common.common_section() }}
[buildout]
extends = {{ template_monitor }}
parts +=
apache-certificate-authority
fix-ca-folder
monitor-base
[monitor-conf-parameters] [monitor-conf-parameters]
monitor-title = ERP5 monitor-title = ERP5
password = ${monitor-htpasswd:passwd} password = ${monitor-htpasswd:passwd}
......
...@@ -61,7 +61,6 @@ extends = ...@@ -61,7 +61,6 @@ extends =
../../component/postfix/buildout.cfg ../../component/postfix/buildout.cfg
../../component/zbarlight/buildout.cfg ../../component/zbarlight/buildout.cfg
../../component/perl/buildout.cfg ../../component/perl/buildout.cfg
../monitor/buildout.cfg
../../stack/caucase/buildout.cfg ../../stack/caucase/buildout.cfg
../../software/jupyter/software.cfg ../../software/jupyter/software.cfg
../../software/neoppod/software-common.cfg ../../software/neoppod/software-common.cfg
...@@ -294,7 +293,6 @@ context = ...@@ -294,7 +293,6 @@ context =
key template_kumofs template-kumofs:target key template_kumofs template-kumofs:target
key template_mariadb template-mariadb:target key template_mariadb template-mariadb:target
key template_mariadb_initial_setup template-mariadb-initial-setup:target key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_monitor monitor2-template:rendered
key template_my_cnf template-my-cnf:target key template_my_cnf template-my-cnf:target
key template_postfix template-postfix:target key template_postfix template-postfix:target
key template_postfix_aliases template-postfix-aliases:target key template_postfix_aliases template-postfix-aliases:target
......
...@@ -26,11 +26,11 @@ md5sum = d95e8500bdc72d1f40b97cc414656e7e ...@@ -26,11 +26,11 @@ md5sum = d95e8500bdc72d1f40b97cc414656e7e
[template-mariadb] [template-mariadb]
filename = instance-mariadb.cfg.in filename = instance-mariadb.cfg.in
md5sum = 2d687117150528fb5aad503874a1ad33 md5sum = b2fea225fbeadcbf004eb2e2e3a68156
[template-kumofs] [template-kumofs]
filename = instance-kumofs.cfg.in filename = instance-kumofs.cfg.in
md5sum = fe6ae121134a0e5bdb060073478be44e md5sum = 13315c109deab534b81e7a45e7320eea
[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 = d920170577b611f973145c5807b01fce md5sum = cbcb5f4c2885e3f2589770e76a422be7
[template-postfix-master-cf] [template-postfix-master-cf]
filename = postfix_master.cf.in filename = postfix_master.cf.in
...@@ -70,7 +70,7 @@ md5sum = c64f35f825200fe35328641b2b8e0fdd ...@@ -70,7 +70,7 @@ md5sum = c64f35f825200fe35328641b2b8e0fdd
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 1f88fb841394a1d24b7cc01f966c7b21 md5sum = f81f4c9881bf868882cd56fe6a769666
[monitor-template-dummy] [monitor-template-dummy]
filename = dummy.cfg filename = dummy.cfg
...@@ -78,19 +78,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e ...@@ -78,19 +78,19 @@ md5sum = d41d8cd98f00b204e9800998ecf8427e
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 4e03b3fba30162019eae76132555dcde md5sum = ff2f4d9f806fa783421d34204f2a74c8
[template-zeo] [template-zeo]
filename = instance-zeo.cfg.in filename = instance-zeo.cfg.in
md5sum = d400c3d449ce437a0ded77ee3d5c5df2 md5sum = 10a01b85c966ad9fe13bc981f1ddabe8
[template-zope] [template-zope]
filename = instance-zope.cfg.in filename = instance-zope.cfg.in
md5sum = 5cbfcc02ffe6c2ae8cdf412134addd8f md5sum = d9da770b4a83a58db8637f0eba97f4e8
[template-balancer] [template-balancer]
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 3034ccaa76dbb94f4fe07150a4681843 md5sum = 10c620e934397390dc9b737453aab387
[template-haproxy-cfg] [template-haproxy-cfg]
filename = haproxy.cfg.in filename = haproxy.cfg.in
......
...@@ -264,7 +264,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }} ...@@ -264,7 +264,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
...@@ -414,12 +414,6 @@ monitor-httpd-port = 8386 ...@@ -414,12 +414,6 @@ monitor-httpd-port = 8386
{{ root_common.common_section() }} {{ root_common.common_section() }}
[buildout]
extends = {{ template_monitor }}
parts +=
monitor-base
[monitor-conf-parameters] [monitor-conf-parameters]
monitor-title = ERP5 monitor-title = ERP5
password = ${monitor-htpasswd:passwd} password = ${monitor-htpasswd:passwd}
......
{% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%} {% set use_ipv6 = slapparameter_dict.get('use-ipv6', False) -%}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
publish publish
kumofs-instance kumofs-instance
......
...@@ -362,7 +362,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }} ...@@ -362,7 +362,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
...@@ -278,7 +278,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }} ...@@ -278,7 +278,6 @@ password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts = parts =
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
...@@ -212,8 +212,7 @@ password = {{ slapparameter_dict['monitor-passwd'] }} ...@@ -212,8 +212,7 @@ password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
{{ part_list | join('\n ') }} {{ part_list | join('\n ') }}
publish publish
...@@ -521,8 +521,7 @@ password = {{ slapparameter_dict['monitor-passwd'] }} ...@@ -521,8 +521,7 @@ password = {{ slapparameter_dict['monitor-passwd'] }}
[buildout] [buildout]
extends = extends =
{{ logrotate_cfg }} {{ template_monitor }}
{{ parameter_dict['template-monitor'] }}
parts += parts +=
{{ '\n '.join(part_list) }} {{ '\n '.join(part_list) }}
publish publish
...@@ -18,7 +18,6 @@ postfix-location = {{ postfix_location }} ...@@ -18,7 +18,6 @@ postfix-location = {{ postfix_location }}
template-postfix-aliases = {{ template_postfix_aliases }} template-postfix-aliases = {{ template_postfix_aliases }}
template-postfix-main-cf = {{ template_postfix_main_cf }} template-postfix-main-cf = {{ template_postfix_main_cf }}
template-postfix-master-cf = {{ template_postfix_master_cf }} template-postfix-master-cf = {{ template_postfix_master_cf }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-postfix] [dynamic-template-postfix]
< = jinja2-template-base < = jinja2-template-base
...@@ -33,7 +32,6 @@ extra-context = ...@@ -33,7 +32,6 @@ extra-context =
default-cloudooo-url = {{ dumps(default_cloudooo_url) }} default-cloudooo-url = {{ dumps(default_cloudooo_url) }}
jupyter-enable-default = {{ jupyter_enable_default }} jupyter-enable-default = {{ jupyter_enable_default }}
local-bt5-repository = {{ ' '.join(local_bt5_repository.split()) }} local-bt5-repository = {{ ' '.join(local_bt5_repository.split()) }}
template-monitor = {{ dumps(template_monitor) }}
[context] [context]
root-common = {{ root_common }} root-common = {{ root_common }}
...@@ -47,7 +45,6 @@ extra-context = ...@@ -47,7 +45,6 @@ extra-context =
key default_cloudooo_url dynamic-template-erp5-parameters:default-cloudooo-url key default_cloudooo_url dynamic-template-erp5-parameters:default-cloudooo-url
key jupyter_enable_default dynamic-template-erp5-parameters:jupyter-enable-default key jupyter_enable_default dynamic-template-erp5-parameters:jupyter-enable-default
key local_bt5_repository dynamic-template-erp5-parameters:local-bt5-repository key local_bt5_repository dynamic-template-erp5-parameters:local-bt5-repository
key template_monitor dynamic-template-erp5-parameters:template-monitor
key openssl_location :openssl-location key openssl_location :openssl-location
import urlparse urlparse import urlparse urlparse
import-list = import-list =
...@@ -66,7 +63,6 @@ run-apachedex-location = {{ bin_directory }}/runApacheDex ...@@ -66,7 +63,6 @@ run-apachedex-location = {{ bin_directory }}/runApacheDex
promise-check-apachedex-result = {{ bin_directory }}/check-apachedex-result promise-check-apachedex-result = {{ bin_directory }}/check-apachedex-result
template-haproxy-cfg = {{ template_haproxy_cfg }} template-haproxy-cfg = {{ template_haproxy_cfg }}
template-apache-conf = {{ template_apache_conf }} template-apache-conf = {{ template_apache_conf }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-balancer] [dynamic-template-balancer]
<= jinja2-template-base <= jinja2-template-base
...@@ -80,7 +76,6 @@ import-list = ...@@ -80,7 +76,6 @@ import-list =
[dynamic-template-zeo-parameters] [dynamic-template-zeo-parameters]
<= default-dynamic-template-parameters <= default-dynamic-template-parameters
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-zeo] [dynamic-template-zeo]
<= jinja2-template-base <= jinja2-template-base
...@@ -105,7 +100,6 @@ jsl = {{ jsl_location }} ...@@ -105,7 +100,6 @@ jsl = {{ jsl_location }}
link-binary = {{ dumps(zope_link_binary) }} link-binary = {{ dumps(zope_link_binary) }}
userhosts = {{ userhosts_location }} userhosts = {{ userhosts_location }}
site-zcml = {{ site_zcml }} site-zcml = {{ site_zcml }}
template-monitor = {{ dumps(template_monitor) }}
extra-path-list = {{ dumps(extra_path_list) }} extra-path-list = {{ dumps(extra_path_list) }}
matplotlibrc = {{ matplotlibrc_location }} matplotlibrc = {{ matplotlibrc_location }}
erp5-location = {{ erp5_location }} erp5-location = {{ erp5_location }}
...@@ -129,7 +123,6 @@ dcron-location = {{ dcron_location }} ...@@ -129,7 +123,6 @@ dcron-location = {{ dcron_location }}
gzip-location = {{ gzip_location }} gzip-location = {{ gzip_location }}
kumo-location = {{ kumo_location }} kumo-location = {{ kumo_location }}
logrotate-location = {{ logrotate_location }} logrotate-location = {{ logrotate_location }}
template-monitor = {{ dumps(template_monitor) }}
[dynamic-template-kumofs] [dynamic-template-kumofs]
<= jinja2-template-base <= jinja2-template-base
...@@ -154,7 +147,6 @@ mariadb-slow-query-report-script = {{ mariadb_slow_query_report_script }} ...@@ -154,7 +147,6 @@ 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 }}
promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-queries-digest-result promise-check-slow-queries-digest-result = {{ bin_directory }}/check-slow-queries-digest-result
percona-tools-location = {{ percona_toolkit_location }} percona-tools-location = {{ percona_toolkit_location }}
template-monitor = {{ template_monitor }}
unixodbc-location = {{ unixodbc_location }} unixodbc-location = {{ unixodbc_location }}
[dynamic-template-mariadb] [dynamic-template-mariadb]
......
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
# not need these here). # not need these here).
[monitor2-template] [monitor2-template]
filename = instance-monitor.cfg.jinja2.in filename = instance-monitor.cfg.jinja2.in
md5sum = da5fa743dba8709dfdd9c2d474741de8 md5sum = e713bc55b68e3102f20902abc9f34f4b
...@@ -97,7 +97,7 @@ parameter-file-path = ${monitor-instance-parameter:configuration-file-path} ...@@ -97,7 +97,7 @@ parameter-file-path = ${monitor-instance-parameter:configuration-file-path}
parameter-list = parameter-list =
raw monitor-user ${monitor-instance-parameter:username} raw monitor-user ${monitor-instance-parameter:username}
htpasswd monitor-password ${httpd-monitor-htpasswd:password-file} ${monitor-instance-parameter:username} ${httpd-monitor-htpasswd:htpasswd-path} htpasswd monitor-password ${monitor-htpasswd:storage-path} ${monitor-instance-parameter:username} ${httpd-monitor-htpasswd:htpasswd-path}
file min-free-disk-MB ${promise-check-free-disk-space:config-threshold-file} file min-free-disk-MB ${promise-check-free-disk-space:config-threshold-file}
${monitor-instance-parameter:instance-configuration} ${monitor-instance-parameter:instance-configuration}
# htpasswd entry: htpasswd key password-file username htpasswd-file # htpasswd entry: htpasswd key password-file username htpasswd-file
...@@ -147,17 +147,13 @@ bytes = 8 ...@@ -147,17 +147,13 @@ bytes = 8
[httpd-monitor-htpasswd] [httpd-monitor-htpasswd]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
password-file = ${directory:etc}/.monitor_pwd
htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd htpasswd-path = ${monitor-directory:etc}/monitor-htpasswd
# Keep multiple lines as password can end with newline char. # Keep multiple lines as password can end with newline char.
command = command =
if [ ! -s "${:htpasswd-path}" ]; then if [ ! -s "${:htpasswd-path}" ]; then
{{ apache_location }}/bin/htpasswd -cb ${:htpasswd-path} ${:user} ${:password} {{ apache_location }}/bin/htpasswd -cb ${:htpasswd-path} ${monitor-instance-parameter:username} ${monitor-instance-parameter:password}
fi fi
if [ ! -s "${:password-file}" ]; then echo "${monitor-instance-parameter:password}" > ${:password-file}; fi
update-command = ${:command} update-command = ${:command}
user = ${monitor-instance-parameter:username}
password = ${monitor-instance-parameter:password}
[monitor-symlink] [monitor-symlink]
recipe = cns.recipe.symlink recipe = cns.recipe.symlink
...@@ -399,7 +395,6 @@ depends = ...@@ -399,7 +395,6 @@ depends =
${cron-entry-logrotate:name} ${cron-entry-logrotate:name}
${logrotate-entry-cron:name} ${logrotate-entry-cron:name}
${certificate-authority-service:wrapper-path} ${certificate-authority-service:wrapper-path}
${monitor-conf:rendered}
${start-monitor:wrapper-path} ${start-monitor:wrapper-path}
${ca-monitor-httpd-service:wrapper-path} ${ca-monitor-httpd-service:wrapper-path}
${monitor-httpd-promise:name} ${monitor-httpd-promise:name}
......
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