Commit f9ff52a4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Merge remote-tracking branch 'origin/master' into erp5testnode

parents 83ad5f25 72a7235a
...@@ -12,8 +12,8 @@ parts = ...@@ -12,8 +12,8 @@ parts =
[curl] [curl]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://curl.haxx.se/download/curl-7.36.0.tar.bz2 url = http://curl.haxx.se/download/curl-7.37.0.tar.bz2
md5sum = e6d1f9d1b59da5062109ffe14e0569a4 md5sum = 7dda0cc2e4136f78d5801ac347be696b
configure-options = configure-options =
--disable-static --disable-static
--disable-ldap --disable-ldap
......
...@@ -15,8 +15,8 @@ parts = ...@@ -15,8 +15,8 @@ parts =
[git] [git]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://www.kernel.org/pub/software/scm/git/git-1.9.3.tar.xz url = https://www.kernel.org/pub/software/scm/git/git-2.0.0.tar.xz
md5sum = 560200d1db05a2dd2b8a2b3718655463 md5sum = 0646202ae979e4339f3e47f2375b5773
configure-options = configure-options =
--with-curl=${curl:location} --with-curl=${curl:location}
--with-openssl=${openssl:location} --with-openssl=${openssl:location}
......
...@@ -11,9 +11,9 @@ extends = ...@@ -11,9 +11,9 @@ extends =
[groonga] [groonga]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
version = 4.0.1 version = 4.0.2
url = http://packages.groonga.org/source/groonga/groonga-${:version}.tar.gz url = http://packages.groonga.org/source/groonga/groonga-${:version}.tar.gz
md5sum = 7bfd1c78fe6506424d3f6e4a689a4619 md5sum = eff2c4cf8e26f57fee66fc843be504d9
configure-options = configure-options =
--disable-static --disable-static
--disable-glibtest --disable-glibtest
......
...@@ -12,11 +12,11 @@ find-links = ...@@ -12,11 +12,11 @@ find-links =
[libreoffice-bin] [libreoffice-bin]
recipe = slapos.recipe.build recipe = slapos.recipe.build
# here, two %s are used, first one is for directory name (eg. x86_64), and second one is for filename (eg. x86-64). # here, two %s are used, first one is for directory name (eg. x86_64), and second one is for filename (eg. x86-64).
version = 4.2.3.3 version = 4.2.4.2
url = http://downloadarchive.documentfoundation.org/libreoffice/old/${:version}/rpm/%s/LibreOffice_${:version}_Linux_%s_rpm.tar.gz url = http://downloadarchive.documentfoundation.org/libreoffice/old/${:version}/rpm/%s/LibreOffice_${:version}_Linux_%s_rpm.tar.gz
# supported architectures md5sums # supported architectures md5sums
md5sum_x86 = 2744ff6f5bd2bca773d6fec8b0558a5f md5sum_x86 = 2f58aafdbfc7e29ae3ed077463a9a329
md5sum_x86-64 = 25f1315fa6a22aefde116302a4146e46 md5sum_x86-64 = 8d6617a8a5a9e4a7655d25c8660386d4
# where office code can be found? # where office code can be found?
officedir = libreoffice4.2 officedir = libreoffice4.2
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
parts = parts =
libuuid libuuid
extenrs = extends =
../perl/buildout.cfg ../perl/buildout.cfg
[libuuid] [libuuid]
......
...@@ -8,7 +8,7 @@ parts = ...@@ -8,7 +8,7 @@ parts =
lxml-python lxml-python
[lxml-python-env] [lxml-python-env]
PATH = ${libxslt:location}/bin:%(PATH)s XSLT_CONFIG = ${libxslt:location}/bin/xslt-config
[lxml-python] [lxml-python]
recipe = zc.recipe.egg:custom recipe = zc.recipe.egg:custom
......
...@@ -56,8 +56,8 @@ environment = ...@@ -56,8 +56,8 @@ environment =
# mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users. # mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users.
# http://mroonga.github.com/ # http://mroonga.github.com/
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = http://packages.groonga.org/source/mroonga/mroonga-4.02.tar.gz url = http://packages.groonga.org/source/mroonga/mroonga-4.03.tar.gz
md5sum = aebd30a3cec90182ee474693216ac1dc md5sum = 19ab2721d2d41c234e018a879f392990
configure-options = configure-options =
--with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version} --with-mysql-source=${mariadb:location}__compile__/mariadb-${mariadb:version}
--with-mysql-config=${mariadb:location}/bin/mysql_config --with-mysql-config=${mariadb:location}/bin/mysql_config
......
...@@ -16,8 +16,8 @@ parts = ...@@ -16,8 +16,8 @@ parts =
[openssl] [openssl]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
url = https://www.openssl.org/source/openssl-1.0.1g.tar.gz url = https://www.openssl.org/source/openssl-1.0.1h.tar.gz
md5sum = de62b43dfcd858e66a74bee1c834e959 md5sum = 8d6d684a9430d5cc98a62a5d8fbda8cf
depends = depends =
${ca-certificates:version} ${ca-certificates:version}
patch-binary = ${patch:location}/bin/patch patch-binary = ${patch:location}/bin/patch
......
...@@ -10,8 +10,8 @@ parts = ...@@ -10,8 +10,8 @@ parts =
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
depends = depends =
${perl:version} ${perl:version}
version = 2.2.7 version = 2.2.8
url = http://www.percona.com/redir/downloads/percona-toolkit/${:version}/percona-toolkit-${:version}.tar.gz url = http://www.percona.com/redir/downloads/percona-toolkit/${:version}/percona-toolkit-${:version}.tar.gz
md5sum = 7514af32e0edff70c4934da2e5e36303 md5sum = c7fe343308898ad7f0c456c8394f2cbf
configure-command = configure-command =
${perl:location}/bin/perl Makefile.PL ${perl:location}/bin/perl Makefile.PL
...@@ -9,15 +9,15 @@ parts = ...@@ -9,15 +9,15 @@ parts =
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
depends = depends =
${gdbm:version} ${gdbm:version}
version = 5.18.2 version = 5.20.0
# increase revision when we need to rebuild binary libraries. # increase revision when we need to rebuild binary libraries.
revision = 1 revision = 1
url = http://www.cpan.org/src/5.0/perl-${:version}.tar.bz2 url = http://www.cpan.org/src/5.0/perl-${:version}.tar.bz2
md5sum = d549b16ee4e9210988da39193a9389c1 md5sum = 20cbecd4e9e880ee7a50a136c8b1484e
siteprefix = ${buildout:parts-directory}/site_${:_buildout_section_name_} siteprefix = ${buildout:parts-directory}/site_${:_buildout_section_name_}
patch-options = -p1 patch-options = -p1
patches = patches =
${:_profile_base_location_}/perl-keep-linker-flags-in-ldflags.patch#9873a89c969bd5a478434c3b8b2d57d8 ${:_profile_base_location_}/perl-keep-linker-flags-in-ldflags.patch#4e8e0c59d7176eafb0c7402dea17bef1
configure-command = configure-command =
sh Configure -des \ sh Configure -des \
-Dprefix=${buildout:parts-directory}/${:_buildout_section_name_} \ -Dprefix=${buildout:parts-directory}/${:_buildout_section_name_} \
......
--- perl-5.12.3/Configure.orig 2011-01-09 21:20:52.000000000 +0100 --- perl-5.20.0/Configure.orig 2014-05-28 15:27:22.865060361 +0200
+++ perl-5.12.3/Configure 2011-01-26 19:33:33.106561007 +0100 +++ perl-5.20.0/Configure 2014-05-28 15:32:14.297064994 +0200
@@ -8092,16 +8092,7 @@ @@ -8277,16 +8277,7 @@
case "$dflt" in case "$dflt" in
none) dflt='' ;; none) dflt='' ;;
esac esac
......
...@@ -135,7 +135,7 @@ mr.developer = 1.30 ...@@ -135,7 +135,7 @@ mr.developer = 1.30
netaddr = 0.7.11 netaddr = 0.7.11
pyparsing = 2.0.2 pyparsing = 2.0.2
six = 1.6.1 six = 1.6.1
slapos.core = 1.0.5 slapos.core = 1.1.2
slapos.libnetworkcache = 0.14.1 slapos.libnetworkcache = 0.14.1
slapos.recipe.cmmi = 0.2 slapos.recipe.cmmi = 0.2
stevedore = 0.15 stevedore = 0.15
...@@ -143,25 +143,25 @@ xml-marshaller = 0.9.7 ...@@ -143,25 +143,25 @@ xml-marshaller = 0.9.7
z3c.recipe.scripts = 1.0.1 z3c.recipe.scripts = 1.0.1
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
Flask = 0.10.1 Flask = 0.10.1
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
cliff = 1.6.1 cliff = 1.6.1
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
netifaces = 0.10.3 netifaces = 0.10.3
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
requests = 2.3.0 requests = 2.3.0
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
supervisor = 3.0 supervisor = 3.0
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
zope.interface = 4.1.1 zope.interface = 4.1.1
...@@ -9,8 +9,8 @@ extends = ...@@ -9,8 +9,8 @@ extends =
[squid] [squid]
recipe = hexagonit.recipe.cmmi recipe = hexagonit.recipe.cmmi
url = http://www.squid-cache.org/Versions/v3/3.2/squid-3.2.1.tar.gz url = http://www1.at.squid-cache.org/Versions/v3/3.4/squid-3.4.4.tar.gz
md5sum = 3fb81acc6b70a432e3f0d8a0491056dc md5sum = b36ab3696485a86b43d9194ac9b6b7fe
configure-options = configure-options =
--disable-dependency-tracking --disable-dependency-tracking
--disable-translation --disable-translation
......
...@@ -162,7 +162,6 @@ class Recipe(GenericBaseRecipe): ...@@ -162,7 +162,6 @@ class Recipe(GenericBaseRecipe):
for pt_script_name in ( for pt_script_name in (
'pt-align', 'pt-align',
'pt-archiver', 'pt-archiver',
'pt-collect',
'pt-config-diff', 'pt-config-diff',
'pt-deadlock-logger', 'pt-deadlock-logger',
'pt-diskstats', 'pt-diskstats',
...@@ -175,12 +174,10 @@ class Recipe(GenericBaseRecipe): ...@@ -175,12 +174,10 @@ class Recipe(GenericBaseRecipe):
'pt-index-usage', 'pt-index-usage',
'pt-ioprofile', 'pt-ioprofile',
'pt-kill', 'pt-kill',
'pt-log-player',
'pt-mext', 'pt-mext',
'pt-mysql-summary', 'pt-mysql-summary',
'pt-online-schema-change', 'pt-online-schema-change',
'pt-pmp', 'pt-pmp',
'pt-query-advisor',
'pt-query-digest', 'pt-query-digest',
'pt-show-grants', 'pt-show-grants',
'pt-sift', 'pt-sift',
...@@ -192,8 +189,6 @@ class Recipe(GenericBaseRecipe): ...@@ -192,8 +189,6 @@ class Recipe(GenericBaseRecipe):
'pt-table-checksum', 'pt-table-checksum',
'pt-table-sync', 'pt-table-sync',
'pt-table-usage', 'pt-table-usage',
'pt-tcp-model',
'pt-trend',
'pt-upgrade', 'pt-upgrade',
'pt-variable-advisor', 'pt-variable-advisor',
'pt-visual-explain', 'pt-visual-explain',
......
...@@ -4,6 +4,7 @@ extends = ...@@ -4,6 +4,7 @@ extends =
../../component/git/buildout.cfg ../../component/git/buildout.cfg
../../stack/slapos.cfg ../../stack/slapos.cfg
../../component/dash/buildout.cfg
../../component/binutils/buildout.cfg ../../component/binutils/buildout.cfg
../../component/lxml-python/buildout.cfg ../../component/lxml-python/buildout.cfg
../../component/apache/buildout.cfg ../../component/apache/buildout.cfg
...@@ -13,10 +14,13 @@ extends = ...@@ -13,10 +14,13 @@ extends =
../../component/logrotate/buildout.cfg ../../component/logrotate/buildout.cfg
../../component/rdiff-backup/buildout.cfg ../../component/rdiff-backup/buildout.cfg
../../component/squid/buildout.cfg ../../component/squid/buildout.cfg
# Monitoring stack
../../stack/monitor/buildout.cfg
parts += parts +=
slapos-cookbook slapos-cookbook
slapos-toolbox slapos-toolbox
eggs
template template
template-apache-frontend template-apache-frontend
template-apache-replicate template-apache-replicate
...@@ -36,12 +40,16 @@ recipe = zc.recipe.egg ...@@ -36,12 +40,16 @@ recipe = zc.recipe.egg
eggs = eggs =
${lxml-python:egg} ${lxml-python:egg}
slapos.toolbox slapos.toolbox
plone.recipe.command
scripts = scripts =
killpidfromfile killpidfromfile
onetimedownload onetimedownload
[eggs]
recipe = zc.recipe.egg
eggs =
plone.recipe.command
[check-recipe] [check-recipe]
recipe = plone.recipe.command recipe = plone.recipe.command
stop-on-error = true stop-on-error = true
...@@ -59,20 +67,20 @@ mode = 0644 ...@@ -59,20 +67,20 @@ mode = 0644
[template-apache-frontend] [template-apache-frontend]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-apache-frontend.cfg url = ${:_profile_base_location_}/instance-apache-frontend.cfg
md5sum = f0a507fed2b1dcab5530c892adce8327 md5sum = f5ec3d3b29d20ccdb00e3b64aa588fa5
output = ${buildout:directory}/template-apache-frontend.cfg output = ${buildout:directory}/template-apache-frontend.cfg
mode = 0644 mode = 0644
[template-apache-replicate] [template-apache-replicate]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-apache-replicate.cfg.in url = ${:_profile_base_location_}/instance-apache-replicate.cfg.in
md5sum = 02658d39fa429fef7faba9658e4f1474 md5sum = 82c88a4b4856bfffec3d7ef24e372f38
mode = 0644 mode = 0644
[template-slave-list] [template-slave-list]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/apache-custom-slave-list.cfg.in url = ${:_profile_base_location_}/templates/apache-custom-slave-list.cfg.in
md5sum = f002a8fc8fc5d18adbd8ac1ee054e852 md5sum = 5c49a66a0fe4b92ab21ef7148ea4e5ff
mode = 640 mode = 640
[template-slave-configuration] [template-slave-configuration]
...@@ -90,7 +98,7 @@ mode = 640 ...@@ -90,7 +98,7 @@ mode = 640
[template-apache-frontend-configuration] [template-apache-frontend-configuration]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/apache.conf.in url = ${:_profile_base_location_}/templates/apache.conf.in
md5sum = bae89ebc6c5e75b12535fbd6c37f647d md5sum = 72922908c1f4e72c92bb03e072660c7c
mode = 640 mode = 640
[template-apache-cached-configuration] [template-apache-cached-configuration]
...@@ -121,7 +129,7 @@ mode = 640 ...@@ -121,7 +129,7 @@ mode = 640
[template-default-virtualhost] [template-default-virtualhost]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/000.conf.in url = ${:_profile_base_location_}/templates/000.conf.in
md5sum = c2bbf029e6adc432de0884fb5cf5d2ab md5sum = b40ffdab93a80b40046e3bbb2f7a58bc
mode = 640 mode = 640
[template-default-slave-virtualhost] [template-default-slave-virtualhost]
...@@ -139,7 +147,7 @@ mode = 640 ...@@ -139,7 +147,7 @@ mode = 640
[template-squid-configuration] [template-squid-configuration]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/squid.conf.jinja2 url = ${:_profile_base_location_}/templates/squid.conf.jinja2
md5sum = 9f70474181372d34c8cd203f24ab546e md5sum = f17753fa87da074bc949b2967a330099
mode = 640 mode = 640
[template-empty] [template-empty]
...@@ -147,3 +155,10 @@ recipe = slapos.recipe.build:download ...@@ -147,3 +155,10 @@ recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/templates/empty.in url = ${:_profile_base_location_}/templates/empty.in
md5sum = c2314c3a9c3412a38d14b312d3df83c1 md5sum = c2314c3a9c3412a38d14b312d3df83c1
mode = 640 mode = 640
[template-wrapper]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/templates/wrapper.in
output = ${buildout:directory}/template-wrapper.cfg
mode = 0644
md5sum = 8cde04bfd0c0e9bd56744b988275cfd8
...@@ -21,11 +21,33 @@ parts = ...@@ -21,11 +21,33 @@ parts =
promise-squid promise-squid
dynamic-template-default-vh dynamic-template-default-vh
not-found-html not-found-html
promise-frontend-apache-configuration
promise-cached-apache-configuration
promise-apache-frontend-v4-https promise-apache-frontend-v4-https
promise-apache-frontend-v4-http promise-apache-frontend-v4-http
promise-apache-frontend-v6-https promise-apache-frontend-v6-https
promise-apache-frontend-v6-http promise-apache-frontend-v6-http
promise-apache-cached promise-apache-cached
## Monitoring part
###Parts to add for monitoring
certificate-authority
cron-entry-monitor
cron-entry-rss
deploy-index
deploy-settings-cgi
deploy-status-cgi
setup-static-files
certificate-authority
zero-parameters
public-symlink
cgi-httpd-wrapper
cgi-httpd-graceful-wrapper
monitor-promise
monitor-instance-log-access
## Monitor for apache
monitor-current-log-access
monitor-backup-log-access
extends = ${monitor-template:output}
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
...@@ -95,6 +117,14 @@ apache-directory = ${apache-2.2:location} ...@@ -95,6 +117,14 @@ apache-directory = ${apache-2.2:location}
apache-ipv6 = $${instance-parameter:ipv6-random} apache-ipv6 = $${instance-parameter:ipv6-random}
apache-https-port = $${instance-parameter:configuration.port} apache-https-port = $${instance-parameter:configuration.port}
[monitor-current-log-access]
< = monitor-directory-access
source = $${directory:log}
[monitor-backup-log-access]
< = monitor-directory-access
source = $${directory:logrotate-backup}
[jinja2-template-base] [jinja2-template-base]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename} rendered = $${buildout:directory}/$${:filename}
...@@ -140,6 +170,7 @@ extra-context = ...@@ -140,6 +170,7 @@ extra-context =
section logrotate_dict logrotate section logrotate_dict logrotate
section frontend_configuration frontend-configuration section frontend_configuration frontend-configuration
section apache_configuration apache-configuration section apache_configuration apache-configuration
section connection_information_dict publish-connection-informations
[dynamic-custom-group-template-slave-list] [dynamic-custom-group-template-slave-list]
< = jinja2-template-base < = jinja2-template-base
...@@ -292,6 +323,10 @@ pid-file = $${directory:run}/httpd.pid ...@@ -292,6 +323,10 @@ pid-file = $${directory:run}/httpd.pid
protected-path = / protected-path = /
access-control-string = none access-control-string = none
cached-rewrite-file = $${directory:etc}/apache_rewrite_cached.txt cached-rewrite-file = $${directory:etc}/apache_rewrite_cached.txt
frontend-configuration-verification = ${apache-2.2:location}/bin/httpd -Sf $${:frontend-configuration}
frontend-graceful-command = $${:frontend-configuration-verification}; if [ $? -eq 0 ]; then kill -USR1 $(cat $${:pid-file}); fi
cached-configuration-verification = ${apache-2.2:location}/bin/httpd -Sf $${:cached-configuration}
cached-graceful-command = $${:cached-configuration-verification}; if [ $? -eq 0 ]; then kill -USR1 $(cat $${apache-configuration:cache-pid-file}); fi
# Apache for cache configuration # Apache for cache configuration
cache-access-log = $${directory:log}/frontend-apache-access-cached.log cache-access-log = $${directory:log}/frontend-apache-access-cached.log
...@@ -381,7 +416,7 @@ name = apache ...@@ -381,7 +416,7 @@ name = apache
log = $${apache-configuration:error-log} $${apache-configuration:access-log} log = $${apache-configuration:error-log} $${apache-configuration:access-log}
frequency = daily frequency = daily
rotatep-num = 30 rotatep-num = 30
post = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1 post = $${apache-configuration:frontend-graceful-command}
sharedscripts = true sharedscripts = true
notifempty = true notifempty = true
create = true create = true
...@@ -393,7 +428,7 @@ name = apache-cached ...@@ -393,7 +428,7 @@ name = apache-cached
log = $${apache-configuration:cache-error-log} $${apache-configuration:cache-access-log} log = $${apache-configuration:cache-error-log} $${apache-configuration:cache-access-log}
frequency = daily frequency = daily
rotatep-num = 30 rotatep-num = 30
post = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:cache-pid-file} SIGUSR1 post = $${apache-configuration:cached-graceful-command}
sharedscripts = true sharedscripts = true
notifempty = true notifempty = true
create = true create = true
...@@ -470,15 +505,39 @@ port = $${apache-configuration:cache-port} ...@@ -470,15 +505,39 @@ port = $${apache-configuration:cache-port}
# End of Squid part # End of Squid part
### Apaches Graceful and promises
[frontend-apache-graceful] [frontend-apache-graceful]
recipe = slapos.cookbook:wrapper < = jinja2-template-base
command-line = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:pid-file} SIGUSR1 template = ${template-wrapper:output}
wrapper-path = $${directory:etc-run}/frontend-apache-graceful rendered = $${directory:etc-run}/frontend-apache-safe-graceful
mode = 0700
extra-context =
key content apache-configuration:frontend-graceful-command
[cached-apache-graceful] [cached-apache-graceful]
recipe = slapos.cookbook:wrapper < = jinja2-template-base
command-line = ${buildout:bin-directory}/killpidfromfile $${apache-configuration:cache-pid-file} SIGUSR1 template = ${template-wrapper:output}
wrapper-path = $${directory:etc-run}/cached-apache-graceful rendered = $${directory:etc-run}/cached-apache-safe-graceful
mode = 0700
extra-context =
key content apache-configuration:cached-graceful-command
# Promises checking configuration:
[promise-frontend-apache-configuration]
< = jinja2-template-base
template = ${template-wrapper:output}
rendered = $${directory:promise}/frontend-apache-configuration-promise
mode = 0700
extra-context =
key content apache-configuration:frontend-configuration-verification
[promise-cached-apache-configuration]
< = jinja2-template-base
template = ${template-wrapper:output}
rendered = $${directory:promise}/cached-apache-configuration-promise
mode = 0700
extra-context =
key content apache-configuration:cached-configuration-verification
[promise-apache-frontend-v4-https] [promise-apache-frontend-v4-https]
recipe = slapos.cookbook:check_port_listening recipe = slapos.cookbook:check_port_listening
......
...@@ -59,20 +59,24 @@ sla-{{ parameter }} = {{ slapparameter_dict.pop( sla_key + parameter ) }} ...@@ -59,20 +59,24 @@ sla-{{ parameter }} = {{ slapparameter_dict.pop( sla_key + parameter ) }}
[replicate] [replicate]
<= slap-connection <= slap-connection
recipe = slapos.cookbook:request recipe = slapos.cookbook:requestoptional
software-url = ${slap-connection:software-release-url} software-url = ${slap-connection:software-release-url}
software-type = {{frontend_type}} software-type = {{frontend_type}}
return = private-ipv4 public-ipv4 slave-instance-information-list return = private-ipv4 public-ipv4 slave-instance-information-list monitor_url
config = {{ ' '.join(slapparameter_dict.keys()) + ' ' + slave_list_name }} config = {{ ' '.join(slapparameter_dict.keys()) + ' ' + slave_list_name }}
{% for parameter, value in slapparameter_dict.iteritems() -%} {% for parameter, value in slapparameter_dict.iteritems() -%}
config-{{parameter}} = {{ value }} config-{{parameter}} = {{ value }}
{% endfor -%} {% endfor -%}
config-{{ slave_list_name }} = {{ json_module.dumps(slave_instance_list) }} config-{{ slave_list_name }} = {{ json_module.dumps(slave_instance_list) }}
connection-monitor_url =
[publish-information] [publish-information]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
domain = {{ slapparameter_dict.get('domain') }} domain = {{ slapparameter_dict.get('domain') }}
slave-amount = {{ slave_instance_list | length }} slave-amount = {{ slave_instance_list | length }}
{% for frontend in frontend_section_list %}
{{ frontend }}-monitor-url = {{ '${' + frontend + ':connection-monitor_url}' }}
{% endfor -%}
{% for frontend in frontend_list -%} {% for frontend in frontend_list -%}
#{{frontend}}-private-ipv4 = ${request-{{frontend}}:private-ipv4} #{{frontend}}-private-ipv4 = ${request-{{frontend}}:private-ipv4}
{% endfor -%} {% endfor -%}
......
...@@ -2,120 +2,105 @@ ...@@ -2,120 +2,105 @@
extends = common.cfg extends = common.cfg
[versions] [versions]
Jinja2 = 2.6 Jinja2 = 2.7.2
Werkzeug = 0.8.3 MarkupSafe = 0.23
apache-libcloud = 0.12.3 PyRSS2Gen = 1.1
Werkzeug = 0.9.4
apache-libcloud = 0.14.1
async = 0.6.1 async = 0.6.1
buildout-versions = 1.7 buildout-versions = 1.7
gitdb = 0.5.4
hexagonit.recipe.cmmi = 2.0
meld3 = 0.6.10
pycrypto = 2.6
rdiff-backup = 1.0.5
slapos.recipe.build = 0.11.6
slapos.recipe.cmmi = 0.1.1
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.34.0
smmap = 0.8.2
z3c.recipe.scripts = 1.0.1
cliff = 1.4.4
cmd2 = 0.6.5.1
prettytable = 0.7.2
requests = 1.2.3
slapos.cookbook = 0.82
cffi = 0.8.2 cffi = 0.8.2
cmd2 = 0.6.7
cns.recipe.symlink = 0.2.3
collective.recipe.template = 1.11
cryptography = 0.4 cryptography = 0.4
gitdb = 0.5.4
hexagonit.recipe.cmmi = 2.0
inotifyx = 0.2.0-1
itsdangerous = 0.24
lxml = 3.3.5
meld3 = 1.0.0
mr.developer = 1.30
netaddr = 0.7.11
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pyOpenSSL = 0.14 pyOpenSSL = 0.14
pycrypto = 2.6.1
pyparsing = 2.0.2
pytz = 2014.3
rdiff-backup = 1.0.5
six = 1.6.1 six = 1.6.1
slapos.cookbook = 0.87
slapos.recipe.build = 0.12
slapos.recipe.cmmi = 0.2
slapos.recipe.template = 2.5
slapos.toolbox = 0.39.2
smmap = 0.8.2
stevedore = 0.15
# Required by: # Required by:
# cffi==0.8.2 # slapos.core==1.0.5
pycparser = 2.10 # slapos.toolbox==0.39.2
# Required by: Flask = 0.10.1
# slapos.cookbook==0.82
lock-file = 2.0
# Required by:
# slapos.core==0.35.1
# slapos.toolbox==0.34.0
Flask = 0.9
# Required by: # Required by:
# slapos.toolbox==0.34.0 # slapos.toolbox==0.39.2
GitPython = 0.3.2.RC1 GitPython = 0.3.2.RC1
# Required by: # Required by:
# slapos.toolbox==0.34.0 # slapos.toolbox==0.39.2
atomize = 0.1.1 atomize = 0.2.0
# Required by:
# slapos.toolbox==0.34.0
feedparser = 5.1.3
# Required by: # Required by:
# slapos.cookbook==0.82 # slapos.core==1.0.5
inotifyx = 0.2.0 cliff = 1.6.1
# Required by: # Required by:
# slapos.cookbook==0.82 # paramiko==1.14.0
# slapos.core==0.35.1 ecdsa = 0.11
# xml-marshaller==0.9.7
lxml = 3.1.2
# Required by: # Required by:
# slapos.cookbook==0.82 # slapos.toolbox==0.39.2
netaddr = 0.7.10 feedparser = 5.1.3
# Required by:
# slapos.core==0.35.1
netifaces = 0.10.3
# Required by: # Required by:
# slapos.toolbox==0.34.0 # slapos.cookbook==0.87
paramiko = 1.10.1 lock-file = 2.0
# Required by: # Required by:
# slapos.toolbox==0.34.0 # slapos.core==1.0.5
psutil = 0.7.0 netifaces = 0.10.4
# Required by: # Required by:
# slapos.core==0.35.1 # slapos.toolbox==0.39.2
pyflakes = 0.7 paramiko = 1.14.0
# Required by: # Required by:
# slapos.cookbook==0.82 # slapos.toolbox==0.39.2
pytz = 2013b psutil = 2.1.1
# Required by: # Required by:
# slapos.cookbook==0.82 # cffi==0.8.2
# slapos.core==0.35.1 pycparser = 2.10
# slapos.toolbox==0.34.0
# zc.buildout==1.6.0-dev-SlapOS-010
# zc.recipe.egg==1.3.2
setuptools = 0.6c12dev-r88846
# Required by: # Required by:
# slapos.cookbook==0.82 # slapos.core==1.0.5
# slapos.toolbox==0.34.0 requests = 2.3.0
slapos.core = 0.35.1
# Required by: # Required by:
# slapos.core==0.35.1 # slapos.toolbox==0.39.2
supervisor = 3.0b1 slapos.core = 1.0.5
# Required by: # Required by:
# slapos.core==0.35.1 # slapos.core==1.0.5
unittest2 = 0.5.1 supervisor = 3.0
# Required by: # Required by:
# slapos.cookbook==0.82 # slapos.toolbox==0.39.2
# slapos.toolbox==0.34.0
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
# Required by: # Required by:
# slapos.core==0.35.1 # slapos.core==1.0.5
zope.interface = 4.0.5 zope.interface = 4.1.1
[networkcache] [networkcache]
# signature certificates of the following uploaders. # signature certificates of the following uploaders.
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
ServerName www.example.org ServerName www.example.org
SSLEngine on SSLEngine on
SSLProxyEngine on SSLProxyEngine on
SSLProtocol -ALL +SSLv3 +TLSv1 SSLProtocol ALL -SSLv2
SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH
# Rewrite part # Rewrite part
ProxyVia On ProxyVia On
......
...@@ -53,7 +53,7 @@ log = {{slave_parameter_dict.get('access_log')}} {{slave_parameter_dict.get('err ...@@ -53,7 +53,7 @@ log = {{slave_parameter_dict.get('access_log')}} {{slave_parameter_dict.get('err
backup = {{ '${' + slave_directory_section + ':log-folder}' }} backup = {{ '${' + slave_directory_section + ':log-folder}' }}
frequency = daily frequency = daily
rotatep-num = 30 rotatep-num = 30
post = ${buildout:bin-directory}/killpidfromfile {{ apache_configuration.get('pid-file') }} SIGUSR1 post = {{ apache_configuration.get('frontend-graceful-command') }}
sharedscripts = true sharedscripts = true
notifempty = true notifempty = true
create = true create = true
...@@ -172,6 +172,10 @@ private-ipv4 = {{ local_ipv4 }} ...@@ -172,6 +172,10 @@ private-ipv4 = {{ local_ipv4 }}
{% if extra_slave_instance_list -%} {% if extra_slave_instance_list -%}
slave-instance-information-list = {{ json_module.dumps(slave_instance_information_list) }} slave-instance-information-list = {{ json_module.dumps(slave_instance_information_list) }}
{% endif -%} {% endif -%}
{% do connection_information_dict.pop('recipe') %}
{% for key, value in connection_information_dict.iteritems() -%}
{{ key }} = {{ value }}
{% endfor %}
{% do part_list.append('cached-rewrite-rules') -%} {% do part_list.append('cached-rewrite-rules') -%}
[cached-rewrite-rules] [cached-rewrite-rules]
......
...@@ -120,9 +120,7 @@ SSLSessionCache shmcb:/{{ httpd_mod_ssl_cache_directory }}/ssl_scache(512000) ...@@ -120,9 +120,7 @@ SSLSessionCache shmcb:/{{ httpd_mod_ssl_cache_directory }}/ssl_scache(512000)
SSLSessionCacheTimeout 300 SSLSessionCacheTimeout 300
SSLRandomSeed startup /dev/urandom 256 SSLRandomSeed startup /dev/urandom 256
SSLRandomSeed connect builtin SSLRandomSeed connect builtin
SSLProtocol -ALL +SSLv3 +TLSv1 SSLProtocol ALL -SSLv2
SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH
<FilesMatch "\.(cgi|shtml|phtml|php)$"> <FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars SSLOptions +StdEnvVars
</FilesMatch> </FilesMatch>
......
...@@ -23,6 +23,8 @@ header_replace X-Forwarded-For ...@@ -23,6 +23,8 @@ header_replace X-Forwarded-For
follow_x_forwarded_for allow all follow_x_forwarded_for allow all
forwarded_for on forwarded_for on
cache_dir aufs {{ cache_path }} 5000 16 256
# Use 1Go of RAM # Use 1Go of RAM
cache_mem 1024 MB cache_mem 1024 MB
# But do not keep big object in RAM # But do not keep big object in RAM
......
#!${dash-output:dash}
{{ content }}
\ No newline at end of file
...@@ -60,6 +60,7 @@ cryptography = 0.4 ...@@ -60,6 +60,7 @@ cryptography = 0.4
itsdangerous = 0.24 itsdangerous = 0.24
meld3 = 1.0.0 meld3 = 1.0.0
mr.developer = 1.30 mr.developer = 1.30
plone.recipe.command = 1.1
pyOpenSSL = 0.14 pyOpenSSL = 0.14
pyparsing = 2.0.2 pyparsing = 2.0.2
six = 1.6.1 six = 1.6.1
...@@ -70,11 +71,11 @@ slapos.recipe.template = 2.5 ...@@ -70,11 +71,11 @@ slapos.recipe.template = 2.5
stevedore = 0.15 stevedore = 0.15
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
Flask = 0.10.1 Flask = 0.10.1
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
cliff = 1.6.1 cliff = 1.6.1
# Required by: # Required by:
...@@ -87,7 +88,7 @@ lock-file = 2.0 ...@@ -87,7 +88,7 @@ lock-file = 2.0
# Required by: # Required by:
# slapos.cookbook==0.87 # slapos.cookbook==0.87
# slapos.core==1.0.5 # slapos.core==1.1.2
# xml-marshaller==0.9.7 # xml-marshaller==0.9.7
lxml = 3.3.5 lxml = 3.3.5
...@@ -96,8 +97,12 @@ lxml = 3.3.5 ...@@ -96,8 +97,12 @@ lxml = 3.3.5
netaddr = 0.7.11 netaddr = 0.7.11
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
netifaces = 0.10.3 netifaces = 0.10.4
# Required by:
# slapos.core==1.1.2
psutil = 2.1.1
# Required by: # Required by:
# cffi==0.8.2 # cffi==0.8.2
...@@ -105,18 +110,18 @@ pycparser = 2.10 ...@@ -105,18 +110,18 @@ pycparser = 2.10
# Required by: # Required by:
# slapos.cookbook==0.87 # slapos.cookbook==0.87
pytz = 2014.2 pytz = 2014.3
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
requests = 2.3.0 requests = 2.3.0
# Required by: # Required by:
# slapos.cookbook==0.87 # slapos.cookbook==0.87
slapos.core = 1.0.5 slapos.core = 1.1.2
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
supervisor = 3.0 supervisor = 3.0
# Required by: # Required by:
...@@ -124,7 +129,7 @@ supervisor = 3.0 ...@@ -124,7 +129,7 @@ supervisor = 3.0
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
zope.interface = 4.1.1 zope.interface = 4.1.1
[networkcache] [networkcache]
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"type": "string" "type": "string"
}, },
"instance-amount": { "instance-amount": {
"description": "number of slappart to deploy inside the runner", "description": "number of slappart to deploy inside the runner. Needs instance to be restarted.",
"type": "integer", "type": "integer",
"default": 10 "default": 10
}, },
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"description": "a relative path from the slapos git repo to a folder containing a software release, which will be automaticaly deployed while the runner instanciation, and only if the parameter auto-deploy is set to 'true'. For example: 'software/helloworld", "description": "a relative path from the slapos git repo to a folder containing a software release, which will be automaticaly deployed while the runner instanciation, and only if the parameter auto-deploy is set to 'true'. For example: 'software/helloworld",
"type": "string" "type": "string"
}, },
"auto-deploy": { "description": "authorizes the software declared with 'slapos-software' to be automatically deployed, or not", "auto-deploy": { "description": "authorizes the software declared with 'slapos-software' to be automatically deployed, or not. Needs instance to be restarted.",
"type": "boolean", "type": "boolean",
"default": "false" "default": "false"
}, },
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
"default": "master" "default": "master"
}, },
"auto-deploy-instance": { "auto-deploy-instance": {
"description": "prevent the runner from deploying and starting instances", "description": "prevent the runner from deploying and starting instances. Needs instance to be restarted.",
"type": "boolean", "type": "boolean",
"default": "true, but is set to false for instances of type 'import' in resiliency" "default": "true, but is set to false for instances of type 'import' in resiliency"
}, },
"autorun": { "autorun": {
"description": "let automaticaly build and run a declared software with 'slapos-software'. Only works if 'slapos-software' is set, and 'auto-deploy' is true", "description": "let automaticaly build and run a declared software with 'slapos-software'. Only works if 'slapos-software' is set, and 'auto-deploy' is true. Needs instance to be restarted.",
"type": "boolean", "type": "boolean",
"default": "false" "default": "false"
}, },
......
...@@ -11,22 +11,6 @@ allowed-eggs-from-site-packages = ...@@ -11,22 +11,6 @@ allowed-eggs-from-site-packages =
include-site-packages = false include-site-packages = false
exec-sitecustomize = false exec-sitecustomize = false
# Use only quite well working sites.
allow-hosts =
*.nexedi.org
*.python.org
*.sourceforge.net
alastairs-place.net
dist.repoze.org
effbot.org
github.com
peak.telecommunity.com
psutil.googlecode.com
www.dabeaz.com
www.owlfish.com
launchpad.net
bitbucket.org
extends = extends =
../component/cups/buildout.cfg ../component/cups/buildout.cfg
../component/dbus/buildout.cfg ../component/dbus/buildout.cfg
...@@ -109,17 +93,16 @@ lxml = 3.3.5 ...@@ -109,17 +93,16 @@ lxml = 3.3.5
meld3 = 1.0.0 meld3 = 1.0.0
mr.developer = 1.30 mr.developer = 1.30
netaddr = 0.7.11 netaddr = 0.7.11
netifaces = 0.10.3 netifaces = 0.10.4
plone.recipe.command = 1.1 plone.recipe.command = 1.1
psutil = 2.1.1
pyOpenSSL = 0.14 pyOpenSSL = 0.14
pyparsing = 2.0.2 pyparsing = 2.0.2
python-magic = 0.4.6 python-magic = 0.4.6
pytz = 2014.2 pytz = 2014.3
rdiff-backup = 1.0.5 rdiff-backup = 1.0.5
requests = 2.3.0 requests = 2.3.0
six = 1.6.1 six = 1.6.1
slapos.core = 1.0.5 slapos.core = 1.1.2
slapos.recipe.build = 0.12 slapos.recipe.build = 0.12
slapos.recipe.cmmi = 0.2 slapos.recipe.cmmi = 0.2
slapos.recipe.template = 2.5 slapos.recipe.template = 2.5
...@@ -128,7 +111,7 @@ supervisor = 3.0 ...@@ -128,7 +111,7 @@ supervisor = 3.0
xml-marshaller = 0.9.7 xml-marshaller = 0.9.7
# Required by: # Required by:
# slapos.core==1.0.5 # slapos.core==1.1.2
Flask = 0.10.1 Flask = 0.10.1
# Required by: # Required by:
...@@ -138,7 +121,7 @@ PasteDeploy = 1.5.2 ...@@ -138,7 +121,7 @@ PasteDeploy = 1.5.2
# Required by: # Required by:
# cloudooo==1.2.5-dev # cloudooo==1.2.5-dev
argparse = 1.1 argparse = 1.2.1
# Required by: # Required by:
# cloudooo==1.2.5-dev # cloudooo==1.2.5-dev
...@@ -148,11 +131,15 @@ erp5.util = 0.4.38 ...@@ -148,11 +131,15 @@ erp5.util = 0.4.38
# slapos.cookbook==0.87 # slapos.cookbook==0.87
lock-file = 2.0 lock-file = 2.0
# Required by:
# slapos.core==1.1.2
psutil = 2.1.1
# Required by: # Required by:
# cffi==0.8.2 # cffi==0.8.2
pycparser = 2.10 pycparser = 2.10
# Required by: # Required by:
# cloudooo==1.2.5-dev # cloudooo==1.2.5-dev
# slapos.core==1.0.5 # slapos.core==1.1.2
zope.interface = 4.1.1 zope.interface = 4.1.1
...@@ -172,7 +172,7 @@ context = ...@@ -172,7 +172,7 @@ context =
[template-mariadb] [template-mariadb]
< = template-jinja2-base < = template-jinja2-base
filename = instance-mariadb.cfg filename = instance-mariadb.cfg
md5sum = 49ae6f1bf97d3755978fe08b8e29fb5a md5sum = e0c923a8195b5a36c7df766c1fb4bfdb
extra-context = extra-context =
key coreutils_location coreutils:location key coreutils_location coreutils:location
key dcron_location dcron:location key dcron_location dcron:location
...@@ -590,9 +590,6 @@ Products.PluggableAuthService = 1.9.0 ...@@ -590,9 +590,6 @@ Products.PluggableAuthService = 1.9.0
# --library-dirs, so we use our modified version # --library-dirs, so we use our modified version
pysvn = 1.7.4nxd006 pysvn = 1.7.4nxd006
# use newest version of pytz
pytz =
# we are still using this old stable version. # we are still using this old stable version.
rdiff-backup = 1.0.5 rdiff-backup = 1.0.5
...@@ -600,7 +597,7 @@ rdiff-backup = 1.0.5 ...@@ -600,7 +597,7 @@ rdiff-backup = 1.0.5
slapos.cookbook = slapos.cookbook =
# we need to define an explicit version of slapos.core that is propagated to instances # we need to define an explicit version of slapos.core that is propagated to instances
slapos.core = 1.0.3 slapos.core = 1.1.2
# modified version that works fine for buildout installation # modified version that works fine for buildout installation
SOAPpy = 0.12.0nxd001 SOAPpy = 0.12.0nxd001
...@@ -622,8 +619,6 @@ zope.app.publication = 3.14.0 ...@@ -622,8 +619,6 @@ zope.app.publication = 3.14.0
zope.app.testing = 3.8.1 zope.app.testing = 3.8.1
# Pinned versions # Pinned versions
Flask = 0.10.1
GitPython = 0.3.2.RC1
MarkupSafe = 0.23 MarkupSafe = 0.23
MySQL-python = 1.2.5 MySQL-python = 1.2.5
PIL = 1.1.7 PIL = 1.1.7
...@@ -635,8 +630,7 @@ Products.LongRequestLogger = 1.1.0 ...@@ -635,8 +630,7 @@ Products.LongRequestLogger = 1.1.0
Products.MimetypesRegistry = 2.0.5 Products.MimetypesRegistry = 2.0.5
Products.PluginRegistry = 1.3 Products.PluginRegistry = 1.3
Products.TIDStorage = 5.4.9 Products.TIDStorage = 5.4.9
Products.ZSQLMethods = 2.13.4 PyPDF2 = 1.22
PyPDF2 = 1.21
PyXML = 0.8.5 PyXML = 0.8.5
Pympler = 0.3.1 Pympler = 0.3.1
StructuredText = 2.11.1 StructuredText = 2.11.1
...@@ -645,50 +639,35 @@ Werkzeug = 0.9.4 ...@@ -645,50 +639,35 @@ Werkzeug = 0.9.4
apache-libcloud = 0.14.1 apache-libcloud = 0.14.1
astroid = 1.1.1 astroid = 1.1.1
async = 0.6.1 async = 0.6.1
atomize = 0.2.0
buildout-versions = 1.7 buildout-versions = 1.7
chardet = 2.2.1 chardet = 2.2.1
cliff = 1.6.1
cmd2 = 0.6.7 cmd2 = 0.6.7
csp-eventlet = 0.7.0 csp-eventlet = 0.7.0
ecdsa = 0.11
elementtree = 1.2.7-20070827-preview elementtree = 1.2.7-20070827-preview
erp5.recipe.cmmiforcei686 = 0.1.3 erp5.recipe.cmmiforcei686 = 0.1.3
erp5.util = 0.4.38
erp5diff = 0.8.1.5 erp5diff = 0.8.1.5
eventlet = 0.14.0 eventlet = 0.14.0
feedparser = 5.1.3
five.formlib = 1.0.4 five.formlib = 1.0.4
five.localsitemanager = 2.0.5 five.localsitemanager = 2.0.5
fpconst = 0.7.2
gitdb = 0.5.4 gitdb = 0.5.4
greenlet = 0.4.2 greenlet = 0.4.2
hexagonit.recipe.cmmi = 2.0
http-parser = 0.8.3 http-parser = 0.8.3
httplib2 = 0.9 httplib2 = 0.9
iniparse = 0.4
inotifyx = 0.2.0-1 inotifyx = 0.2.0-1
interval = 1.0.0 interval = 1.0.0
ipdb = 0.8 ipdb = 0.8
ipython = 2.0.0 ipython = 2.1.0
itsdangerous = 0.24 itsdangerous = 0.24
lock-file = 2.0 lock-file = 2.0
logilab-common = 0.61.0 logilab-common = 0.61.0
meld3 = 1.0.0 meld3 = 1.0.0
minitage = 2.0.67
minitage.core = 2.0.57
minitage.paste = 1.4.6 minitage.paste = 1.4.6
minitage.recipe.common = 1.90
minitage.recipe.egg = 1.107 minitage.recipe.egg = 1.107
netaddr = 0.7.11 netaddr = 0.7.11
netifaces = 0.10.3
ordereddict = 1.1
paramiko = 1.14.0
plone.recipe.command = 1.1 plone.recipe.command = 1.1
ply = 3.4 ply = 3.4
polib = 1.0.4 polib = 1.0.4
pprofile = 1.7.2 pprofile = 1.7.2
psutil = 2.1.1
pycountry = 1.6 pycountry = 1.6
pyflakes = 0.8.1 pyflakes = 0.8.1
pylint = 1.2.1 pylint = 1.2.1
...@@ -696,11 +675,10 @@ pyparsing = 2.0.2 ...@@ -696,11 +675,10 @@ pyparsing = 2.0.2
python-ldap = 2.4.15 python-ldap = 2.4.15
python-magic = 0.4.6 python-magic = 0.4.6
python-memcached = 1.53 python-memcached = 1.53
pytz = 2014.4
qrcode = 4.0.4 qrcode = 4.0.4
requests = 2.3.0
restkit = 4.2.2 restkit = 4.2.2
rtjp-eventlet = 0.3.2 rtjp-eventlet = 0.3.2
six = 1.6.1
slapos.recipe.build = 0.12 slapos.recipe.build = 0.12
slapos.recipe.cmmi = 0.2 slapos.recipe.cmmi = 0.2
slapos.recipe.template = 2.5 slapos.recipe.template = 2.5
...@@ -710,14 +688,113 @@ socketpool = 0.5.3 ...@@ -710,14 +688,113 @@ socketpool = 0.5.3
spyne = 2.10.10 spyne = 2.10.10
stevedore = 0.15 stevedore = 0.15
suds = 0.4 suds = 0.4
supervisor = 3.0
threadframe = 0.2 threadframe = 0.2
timerserver = 2.0.2 timerserver = 2.0.2
urlnorm = 1.1.2 urlnorm = 1.1.2
uuid = 1.30 uuid = 1.30
validictory = 0.9.3 validictory = 0.9.3
xml-marshaller = 0.9.7
xupdate-processor = 0.4 xupdate-processor = 0.4
# Required by:
# slapos.core==1.1.2
# slapos.toolbox==0.39.2
Flask = 0.10.1
# Required by:
# slapos.toolbox==0.39.2
GitPython = 0.3.2.RC1
# Required by:
# Products.CMFCore==2.2.8
Products.ZSQLMethods = 2.13.4
# Required by:
# slapos.toolbox==0.39.2
atomize = 0.2.0
# Required by:
# slapos.core==1.1.2
cliff = 1.6.1
# Required by:
# paramiko==1.14.0
ecdsa = 0.11
# Required by:
# cloudooo==1.2.5-dev
erp5.util = 0.4.38
# Required by:
# slapos.toolbox==0.39.2
feedparser = 5.1.3
# Required by:
# SOAPpy==0.12.0nxd001
fpconst = 0.7.2
# Required by:
# erp5.recipe.cmmiforcei686==0.1.3
hexagonit.recipe.cmmi = 2.0
# Required by:
# minitage.recipe.egg==1.107
iniparse = 0.4
# Required by:
# minitage.core==2.0.57
minitage = 2.0.67
# Required by:
# minitage.recipe.common==1.90
# minitage.recipe.egg==1.107
minitage.core = 2.0.57
# Required by:
# minitage.recipe.egg==1.107
minitage.recipe.common = 1.90
# Required by:
# slapos.core==1.1.2
netifaces = 0.10.4
# Required by:
# minitage.recipe.egg==1.107
ordereddict = 1.1
# Required by:
# slapos.toolbox==0.39.2
paramiko = 1.14.0
# Required by:
# slapos.core==1.1.2
# slapos.toolbox==0.39.2
psutil = 2.1.1
# Required by:
# slapos.core==1.1.2
requests = 2.3.0
# Required by:
# qrcode==4.0.4
six = 1.6.1
# Required by:
# slapos.core==1.1.2
supervisor = 3.0
# Required by:
# slapos.toolbox==0.39.2
xml-marshaller = 0.9.7
# Required by:
# zope.app.testing==3.8.1
zope.app.debug = 3.4.1 zope.app.debug = 3.4.1
# Required by:
# zope.app.testing==3.8.1
zope.app.dependable = 3.5.1 zope.app.dependable = 3.5.1
# Required by:
# Products.CMFCalendar==2.2.3
# five.formlib==1.0.4
zope.app.form = 4.0.2 zope.app.form = 4.0.2
...@@ -64,7 +64,6 @@ mysql-upgrade-binary = {{ mariadb_location }}/bin/mysql_upgrade ...@@ -64,7 +64,6 @@ mysql-upgrade-binary = {{ mariadb_location }}/bin/mysql_upgrade
mysqld-binary = {{ mariadb_location }}/bin/mysqld mysqld-binary = {{ mariadb_location }}/bin/mysqld
pt-align-binary = {{ perl_siteprefix }}/bin/pt-align pt-align-binary = {{ perl_siteprefix }}/bin/pt-align
pt-archiver-binary = {{ perl_siteprefix }}/bin/pt-archiver pt-archiver-binary = {{ perl_siteprefix }}/bin/pt-archiver
pt-collect-binary = {{ perl_siteprefix }}/bin/pt-collect
pt-config-diff-binary = {{ perl_siteprefix }}/bin/pt-config-diff pt-config-diff-binary = {{ perl_siteprefix }}/bin/pt-config-diff
pt-deadlock-logger-binary = {{ perl_siteprefix }}/bin/pt-deadlock-logger pt-deadlock-logger-binary = {{ perl_siteprefix }}/bin/pt-deadlock-logger
pt-diskstats-binary = {{ perl_siteprefix }}/bin/pt-diskstats pt-diskstats-binary = {{ perl_siteprefix }}/bin/pt-diskstats
...@@ -77,12 +76,10 @@ pt-heartbeat-binary = {{ perl_siteprefix }}/bin/pt-heartbeat ...@@ -77,12 +76,10 @@ pt-heartbeat-binary = {{ perl_siteprefix }}/bin/pt-heartbeat
pt-index-usage-binary = {{ perl_siteprefix }}/bin/pt-index-usage pt-index-usage-binary = {{ perl_siteprefix }}/bin/pt-index-usage
pt-ioprofile-binary = {{ perl_siteprefix }}/bin/pt-ioprofile pt-ioprofile-binary = {{ perl_siteprefix }}/bin/pt-ioprofile
pt-kill-binary = {{ perl_siteprefix }}/bin/pt-kill pt-kill-binary = {{ perl_siteprefix }}/bin/pt-kill
pt-log-player-binary = {{ perl_siteprefix }}/bin/pt-log-player
pt-mext-binary = {{ perl_siteprefix }}/bin/pt-mext pt-mext-binary = {{ perl_siteprefix }}/bin/pt-mext
pt-mysql-summary-binary = {{ perl_siteprefix }}/bin/pt-mysql-summary pt-mysql-summary-binary = {{ perl_siteprefix }}/bin/pt-mysql-summary
pt-online-schema-change-binary = {{ perl_siteprefix }}/bin/pt-online-schema-change pt-online-schema-change-binary = {{ perl_siteprefix }}/bin/pt-online-schema-change
pt-pmp-binary = {{ perl_siteprefix }}/bin/pt-pmp pt-pmp-binary = {{ perl_siteprefix }}/bin/pt-pmp
pt-query-advisor-binary = {{ perl_siteprefix }}/bin/pt-query-advisor
pt-query-digest-binary = {{ perl_siteprefix }}/bin/pt-query-digest pt-query-digest-binary = {{ perl_siteprefix }}/bin/pt-query-digest
pt-show-grants-binary = {{ perl_siteprefix }}/bin/pt-show-grants pt-show-grants-binary = {{ perl_siteprefix }}/bin/pt-show-grants
pt-sift-binary = {{ perl_siteprefix }}/bin/pt-sift pt-sift-binary = {{ perl_siteprefix }}/bin/pt-sift
...@@ -94,8 +91,6 @@ pt-summary-binary = {{ perl_siteprefix }}/bin/pt-summary ...@@ -94,8 +91,6 @@ pt-summary-binary = {{ perl_siteprefix }}/bin/pt-summary
pt-table-checksum-binary = {{ perl_siteprefix }}/bin/pt-table-checksum pt-table-checksum-binary = {{ perl_siteprefix }}/bin/pt-table-checksum
pt-table-sync-binary = {{ perl_siteprefix }}/bin/pt-table-sync pt-table-sync-binary = {{ perl_siteprefix }}/bin/pt-table-sync
pt-table-usage-binary = {{ perl_siteprefix }}/bin/pt-table-usage pt-table-usage-binary = {{ perl_siteprefix }}/bin/pt-table-usage
pt-tcp-model-binary = {{ perl_siteprefix }}/bin/pt-tcp-model
pt-trend-binary = {{ perl_siteprefix }}/bin/pt-trend
pt-upgrade-binary = {{ perl_siteprefix }}/bin/pt-upgrade pt-upgrade-binary = {{ perl_siteprefix }}/bin/pt-upgrade
pt-variable-advisor-binary = {{ perl_siteprefix }}/bin/pt-variable-advisor pt-variable-advisor-binary = {{ perl_siteprefix }}/bin/pt-variable-advisor
pt-visual-explain-binary = {{ perl_siteprefix }}/bin/pt-visual-explain pt-visual-explain-binary = {{ perl_siteprefix }}/bin/pt-visual-explain
......
...@@ -6,28 +6,22 @@ extends = ...@@ -6,28 +6,22 @@ extends =
../../component/dash/buildout.cfg ../../component/dash/buildout.cfg
../../component/dcron/buildout.cfg ../../component/dcron/buildout.cfg
../../component/openssl/buildout.cfg ../../component/openssl/buildout.cfg
../../component/nginx/buildout.cfg
parts += parts =
backup-script-template slapos-cookbook
collective.recipe.template-egg
dcron dcron
download-static-files download-static-files
eggs monitor-eggs
extra-eggs extra-eggs
make-rss
monitor-bin monitor-bin
monitor-template monitor-template
nginx
rss-bin rss-bin
slapos-cookbook
static-folder
template-nginx-conf
[collective.recipe.template-egg] [monitor-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
eggs = collective.recipe.template eggs =
PyRSS2Gen collective.recipe.template
cns.recipe.symlink
[extra-eggs] [extra-eggs]
recipe = zc.recipe.egg recipe = zc.recipe.egg
...@@ -39,8 +33,8 @@ eggs = ...@@ -39,8 +33,8 @@ eggs =
[make-rss-script] [make-rss-script]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/make-rss.sh.in url = ${:_profile_base_location_}/make-rss.sh.in
md5sum = 8d3a4b212784b591316b8b93d6bd163e md5sum = 98c8f6fd81e405b0ad10db07c3776321
output = ${buildout:directory}/make-rss.sh.in output = ${buildout:directory}/template-make-rss.sh.in
mode = 0644 mode = 0644
[monitor-template] [monitor-template]
...@@ -48,14 +42,15 @@ recipe = slapos.recipe.template ...@@ -48,14 +42,15 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/monitor.cfg.in url = ${:_profile_base_location_}/monitor.cfg.in
output = ${buildout:directory}/monitor.cfg output = ${buildout:directory}/monitor.cfg
filename = monitor.cfg filename = monitor.cfg
md5sum = 4db2be5e8cabb5dd1d23743e0db5b02a md5sum = bd592a0f0c41ec15c643c4e91e9ec5cc
mode = 0644 mode = 0644
[monitor-bin] [monitor-bin]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
download-only = true download-only = true
md5sum = 05bbb70f6f69dc4f3fa83dc0f8c9960e md5sum = 1e7b4698f6627150b1eb783b06f8b13a
destination = ${buildout:directory}/parts/monitor-template-monitor-bin
filename = monitor.py.in filename = monitor.py.in
mode = 0644 mode = 0644
...@@ -64,6 +59,7 @@ recipe = hexagonit.recipe.download ...@@ -64,6 +59,7 @@ recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfiles/${:filename} url = ${:_profile_base_location_}/webfiles/${:filename}
download-only = true download-only = true
md5sum = 91ac749f86aecc0c383d93e51e15a572 md5sum = 91ac749f86aecc0c383d93e51e15a572
destination = ${buildout:directory}/parts/monitor-index
filename = index.cgi.in filename = index.cgi.in
mode = 0644 mode = 0644
...@@ -71,7 +67,8 @@ mode = 0644 ...@@ -71,7 +67,8 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfiles/${:filename} url = ${:_profile_base_location_}/webfiles/${:filename}
download-only = true download-only = true
md5sum = aa375a4225e2587b22f68c28cafd7871 destination = ${buildout:directory}/parts/monitor-template-index
md5sum = e0d2aaeffc046b2ac6d9d717e1ba321d
filename = index.html.jinja2 filename = index.html.jinja2
mode = 0644 mode = 0644
...@@ -79,7 +76,8 @@ mode = 0644 ...@@ -79,7 +76,8 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfiles/${:filename} url = ${:_profile_base_location_}/webfiles/${:filename}
download-only = true download-only = true
md5sum = 4e5b7fc5c5c237836c7c81fe3e3bb903 md5sum = aa2764cab87e457410435974f729e906
destination = ${buildout:directory}/parts/monitor-template-status-cgi
filename = status.cgi.in filename = status.cgi.in
mode = 0644 mode = 0644
...@@ -88,6 +86,7 @@ recipe = hexagonit.recipe.download ...@@ -88,6 +86,7 @@ recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/webfiles/${:filename} url = ${:_profile_base_location_}/webfiles/${:filename}
download-only = true download-only = true
md5sum = 18574b804da0c65d8670959f9e7c4774 md5sum = 18574b804da0c65d8670959f9e7c4774
destination = ${buildout:directory}/parts/monitor-template-settings-cgi
filename = settings.cgi.in filename = settings.cgi.in
mode = 0644 mode = 0644
...@@ -95,7 +94,8 @@ mode = 0644 ...@@ -95,7 +94,8 @@ mode = 0644
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
download-only = true download-only = true
md5sum = 427d5135ca475f2a4c4e69a0da6ed8c4 md5sum = 5f1b93ccdea7c3031aef396154c64938
destination = ${buildout:directory}/parts/monitor-template-rss-bin
filename = status2rss.py filename = status2rss.py
mode = 0644 mode = 0644
...@@ -108,18 +108,9 @@ logfile = $${directory:log}/crond.log ...@@ -108,18 +108,9 @@ logfile = $${directory:log}/crond.log
[download-static-files] [download-static-files]
recipe = hexagonit.recipe.download recipe = hexagonit.recipe.download
url = https://github.com/Sebatyne/staticForMonitoring/blob/3f0e93cec706c7ad311ddbf1ebf996965ce2f0a3/static-files.tar.gz?raw=true url = https://github.com/SlapOS/staticForMonitoring/blob/db670e7568871c69a64916d462ccb57629f1c77d/static-files.tar.gz?raw=true
download-only = true download-only = true
md5sum = e98585b85634de48240b2c215e946769 md5sum = 9e3feb2b520620d5b8d478eb9a9be6de
filename = static-files.tar.gz filename = static-files.tar.gz
destination = ${buildout:directory}/parts/monitor-static-files
mode = 0644 mode = 0644
[eggs]
recipe = z3c.recipe.scripts
eggs =
slapos.cookbook
PyRSS2Gen
[versions]
PyRSS2Gen = 1.1
Jinja2 = 2.6
#!${dash-output:dash} #!${dash-output:dash}
STATUS=$${monitor-parameters:result-dir} STATUS_DB={{ monitor_parameters['db-path'] }}
RSS_FILE=$${monitor-parameters:rss-path} RSS_FILE={{ monitor_parameters['rss-path'] }}
PYTHON=${buildout:directory}/bin/${extra-eggs:interpreter} PYTHON=${buildout:directory}/bin/${extra-eggs:interpreter}
STATUS2RSS=${rss-bin:location}/${rss-bin:filename} STATUS2RSS=${rss-bin:location}/${rss-bin:filename}
NAME=`basename $STATUS` $PYTHON $STATUS2RSS "Monitoring RSS feed" "{{ monitor_parameters['url'] }}/{{ monitor_parameters['index-filename'] }}" $STATUS_DB > $RSS_FILE
cat $STATUS/* | $PYTHON $STATUS2RSS "Monitoring RSS feed" "https://[$${slap-parameters:ipv6-random}]:$${monitor-parameters:port}/$${deploy-index:filename}" > $RSS_FILE
This diff is collapsed.
...@@ -5,16 +5,21 @@ import json ...@@ -5,16 +5,21 @@ import json
import os import os
import subprocess import subprocess
import sys import sys
import sqlite3
import time import time
from optparse import OptionParser, make_option from optparse import OptionParser, make_option
FAILURE = "FAILURE"
SUCCESS = "SUCCESS"
db_path = "{{ monitor_parameter['db-path'] }}"
instance_path = "{{ directory['home'] }}" instance_path = "{{ directory['home'] }}"
monitor_dir = "{{ directory['monitor'] }}" monitor_dir = "{{ directory['monitor-custom-scripts'] }}"
pid_dir = "{{ directory['run'] }}" pid_dir = "{{ directory['run'] }}"
promise_dir = "{{ directory['promise'] }}" promise_dir = "{{ directory['promise'] }}"
monitoring_file_json = "{{ monitoring_file_json }}" monitoring_file_json = "{{ monitoring_file_json }}"
monitoring_folder_bool = "{{ monitoring_folder_bool }}"
option_list = [ option_list = [
make_option("-a", "--all", action="store_true", dest="all", make_option("-a", "--all", action="store_true", dest="all",
...@@ -30,16 +35,38 @@ option_list = [ ...@@ -30,16 +35,38 @@ option_list = [
] ]
def init_db():
db = sqlite3.connect(db_path)
c = db.cursor()
c.executescript("""
CREATE TABLE IF NOT EXISTS status (
timestamp INTEGER UNIQUE,
status VARCHAR(255));
CREATE TABLE IF NOT EXISTS individual_status (
timestamp INTEGER,
status VARCHAR(255),
element VARCHAR(255),
output TEXT);
""")
db.commit()
db.close()
def getListOfScripts(directory): def getListOfScripts(directory):
"""
Get the list of script inside of a directory (not recursive)
"""
scripts = [] scripts = []
if os.path.exists(directory) and os.path.isdir(directory): if os.path.exists(directory) and os.path.isdir(directory):
for file in os.listdir(directory): for file_name in os.listdir(directory):
scripts.append(os.path.join(directory, file)) file = os.path.join(directory, file_name)
if os.access(file, os.X_OK) and not os.path.isdir(file):
scripts.append(file)
else: else:
exit("There is a problem in your directories" \ exit("There is a problem in your directories" \
"of monitoring. Please check them") "of monitoring. Please check them")
return scripts return scripts
def runServices(directory): def runServices(directory):
services = getListOfScripts(directory) services = getListOfScripts(directory)
result = {} result = {}
...@@ -49,7 +76,8 @@ def runServices(directory): ...@@ -49,7 +76,8 @@ def runServices(directory):
try: try:
pid = int(open(service_path).read()) pid = int(open(service_path).read())
### because apache (or others) can write sockets ### because apache (or others) can write sockets
except IOError: ### We also ignore not readable pid files
except (IOError, ValueError):
continue continue
try: try:
os.kill(pid, 0) os.kill(pid, 0)
...@@ -91,22 +119,28 @@ def runScripts(directory): ...@@ -91,22 +119,28 @@ def runScripts(directory):
def writeFiles(monitors): def writeFiles(monitors):
timestamp = int(time.time())
date = datetime.datetime.now().ctime()
init_db()
db = sqlite3.connect(db_path)
fail = False fail = False
for i in monitors.values(): for key, value in monitors.iteritems():
if i != "" : element_status = SUCCESS
if value != "" :
fail = True fail = True
element_status = FAILURE
db.execute("insert into individual_status(timestamp, element, output, status) values (?, ?, ?, ?)", (timestamp, key, value, element_status))
db.commit()
status = SUCCESS
if fail: if fail:
message = "FAILURE : something went wrong\n" status = FAILURE
else: db.execute("insert into status(timestamp, status) values (?, ?)", (timestamp, status))
message = "SUCCESS : everything is ok\n" db.commit()
date = datetime.datetime.now().ctime() db.close()
monitors['datetime'] = date monitors['datetime'] = date
file_bool = os.path.join(monitoring_folder_bool, str(time.time()))
open(file_bool, "w+").write(date + "," + message)
open(monitoring_file_json, "w+").write(json.dumps(monitors)) open(monitoring_file_json, "w+").write(json.dumps(monitors))
def main():
if __name__ == "__main__":
parser = OptionParser(option_list=option_list) parser = OptionParser(option_list=option_list)
monitors = {} monitors = {}
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
...@@ -131,3 +165,6 @@ if __name__ == "__main__": ...@@ -131,3 +165,6 @@ if __name__ == "__main__":
else: else:
exit(1) exit(1)
if __name__ == "__main__":
main()
import datetime import datetime
import PyRSS2Gen import PyRSS2Gen
import sys import sys
from email.utils import parsedate_tz, mktime_tz import sqlite3
import time
import base64 import base64
# Based on http://thehelpfulhacker.net/2011/03/27/a-rss-feed-for-your-crontabs/ # Based on http://thehelpfulhacker.net/2011/03/27/a-rss-feed-for-your-crontabs/
...@@ -9,27 +10,36 @@ import base64 ...@@ -9,27 +10,36 @@ import base64
# ### Defaults # ### Defaults
TITLE = sys.argv[1] TITLE = sys.argv[1]
LINK = sys.argv[2] LINK = sys.argv[2]
db_path = sys.argv[3]
DESCRIPTION = TITLE DESCRIPTION = TITLE
SUCCESS = "SUCCESS"
FAILURE = "FAILURE"
items = [] items = []
status = ""
while 1: current_timestamp = int(time.time())
try: # We only build the RSS for the last ten days
line = sys.stdin.readline() period = 3600 * 24 * 10
except KeyboardInterrupt: db = sqlite3.connect(db_path)
break rows = db.execute("select timestamp, status from status where timestamp>? order by timestamp", (current_timestamp - period,))
for row in rows:
line_timestamp, line_status = row
line_status = line_status.encode()
if not line: if line_status == status:
break continue
time, desc = line.split(',', 1) status = line_status
event_time = datetime.datetime.fromtimestamp(line_timestamp).strftime('%Y-%m-%d %H:%M:%S')
rss_item = PyRSS2Gen.RSSItem( rss_item = PyRSS2Gen.RSSItem(
title = desc, title = status,
description = "%s, %s" % (time, desc), description = "%s: %s" % (event_time, status),
link = LINK, link = LINK,
pubDate = datetime.datetime.fromtimestamp(mktime_tz(parsedate_tz(time))), pubDate = event_time,
guid = PyRSS2Gen.Guid(base64.b64encode("%s, %s" % (time, desc))) guid = PyRSS2Gen.Guid(base64.b64encode("%s, %s" % (event_time, status)))
) )
items.append(rss_item) items.append(rss_item)
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
<li><a href="{{ category }}/{{ script }}" class="script">{{ script }}</a></li> <li><a href="{{ category }}/{{ script }}" class="script">{{ script }}</a></li>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
<li class="pure-menu-heading category">Files</li>
<li><a href="./private/" class="link"> User: admin</br> Password is yours</a></li>
</ul> </ul>
</div> </div>
</div> </div>
......
#!{{ python_executable }} #!{{ python_executable }}
import cgi
import cgitb import cgitb
import json import json
import subprocess
def refresh():
command = ["{{ monitor_bin }}", "-a"]
subprocess.call(command)
cgitb.enable(display=0, logdir="/tmp/cgi.log") cgitb.enable(display=0, logdir="/tmp/cgi.log")
form = cgi.FieldStorage()
if "refresh" in form:
refresh()
json_file = "{{ json_file }}" json_file = "{{ json_file }}"
result = json.load(open(json_file)) result = json.load(open(json_file))
...@@ -13,8 +22,12 @@ print "<link rel=\"stylesheet\" href=\"pure-min.css\">" ...@@ -13,8 +22,12 @@ print "<link rel=\"stylesheet\" href=\"pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"/style.css\">" print "<link rel=\"stylesheet\" href=\"/style.css\">"
print "</head><body>" print "</head><body>"
print "<h1>Monitoring :</h1>" print "<h1>Monitoring :</h1>"
print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
print "<input type=\"hidden\" name=\"posting-script\" value=\"{{ pwd }}/{{ this_file }}\">"
print "<p><em>Last time of monitoring process : %s</em></p>" % (result['datetime']) print "<p><em>Last time of monitoring process : %s</em></p>" % (result['datetime'])
del result['datetime'] del result['datetime']
print "<div class=\"pure-controls\"><button type=\"submit\" class=\"pure-button \
pure-button-primary\" name=\"refresh\" value=\"refresh\">Refresh</button></div></form>"
print "<br/>" print "<br/>"
print "<h2>These scripts and promises have failed :</h2>" print "<h2>These scripts and promises have failed :</h2>"
......
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