Closed albinsuresh closed 2 years ago
Since we already have health check mechanism for tedge daemons (tedge-mapper and tedge-agent), we need to expand the mechanism also for the new plugins.
tedge/health-check/<plugin-name>
and tedge/health-check
topics, and respond back to the tedge/heath/<plugin-name>
topic.tedge-watchdog
monitors c8y-configuration-plugin
and c8y-log-plugin
.@PradeepKiruvale I really need to be able to see how is this issue Resolved, please add the Information
Steps to test this feature.
sudo tedge connect c8y
sudo systemctl start c8y-log-plugin.service
c8y-log-plugin.service
sudo tedge mqtt sub
tedge/health/c8y-log-plugin`tedge/health-check
or tedge/health-check/c8y-log-plugin
as below
sudo tedge mqtt pub
tedge/health-check/c8y-log-plugin` ' 'tedge/health/c8y-log-plugin
The message will be as below, the first part is the topic on which the message was received and the second part is the actual message.
[tedge/health/c8y-log-plugin] {"pid":175236,"status":"up","time":1659276372}
Now cross-check the PID
and the status
c8y-log-plugin
up
.Follow the same steps for the testing health-check feature of c8y-configuration-plugin
as well, and replace the c8y-log-plugin
with c8y-configuration-plugin
.
GIVEN thin-edge.io is installed on DUT
AND c8y-log-plugin is installed
AND Connected to Cumulocity `sudo tedge connect c8y`
AND Log plugin service is started `sudo systemctl start c8y-log-plugin.service`
AND You have noted the PID of the c8y-log-plugin.service `pgrep c8y_log_plugin`
WHEN You start a mqtt subscriber `sudo tedge mqtt sub 'tedge/health/c8y-log-plugin' &` [ENTER]
AND You send an empty message `sudo tedge mqtt pub 'tedge/health-check/c8y-log-plugin`
THEN PID is part of the Actual message
AND the status is up
GIVEN thin-edge.io is installed on DUT
AND c8y-configuration-plugin is installed
AND Configuration plugin is started `sudo systemctl start c8y-configuration-plugin.service`
AND You have noted the PID of the c8y-configuration-plugin.service `pgrep c8y_configuration_plugin`
WHEN You start a mqtt subscriber `sudo tedge mqtt sub 'tedge/health/c8y-configuration-plugin' &` [ENTER]
AND You send an empty message sudo tedge mqtt pub 'tedge/health-check/c8y-configuration-plugin' ''
THEN PID is part of the Actual message
AND the status is up
Resolved by #1299
The following tedge daemons currently don't honour the tedge health check mechanism:
c8y-configuration-plugin
c8y-log-plugin
tedge-watchdog
These daemons must also implement the tedge health-check contract by exposing health endpoints via
tedge/health/<plugin-name>
topics.