Promise are a key elements to make sure your service is running as expected. This HowTo will explain how to add a new promise in the context of html5as-base software release.
Here is the commit introducing this functionality to html5as Software release: commit diff.
Add a section for a monitoring promise in instance instance_html5as.cfg.in
. We choose to add a [port-listening-promise]
to check that the nginx service is listening port. It doesn't check if the service return an error or not.
# Port Listening checking promise
[port-listening-promise]
<= monitor-promise-base
module = check_port_listening
name = nginx-port-listening.py
config-hostname = ${html5as:ip}
config-port = ${html5as:port}
Add port-listening-promise
section to the list of processed parts in instance_html5as.cfg.in
as no other processed parts depend on it.
[buildout]
parts =
...
port-listening-promise
...
Refer How To Move to md5sum automatic update to update md5sum
:
$ cd ~/srv/project/slapos/software/html5as-base $ ../../update-hash
To inspect the log of slapos node software
:
$ tail -fn 100 ~/srv/runner/var/log/slapos-node-software.log
To inspect the log of slapos node instance
:
$ tail -fn 100 ~/srv/runner/var/log/slapos-node-instance.log
Observe the log of slapos node Instance
. It now contains the promise info at the end:
2021-03-11 17:46:04 slapos[28239] INFO Checking slappart0 promises... 2021-03-11 17:46:04 slapos[28239] INFO Checking promise nginx-port-listening.py... 2021-03-11 17:46:04 nginx-port-listening.py[28239] INFO port connection OK (('2001:67c:1254:45:a9d5::dd2e', 8086))
For more information, please contact Jean-Paul, CEO of Nexedi (+33 629 02 44 25).