How to monitor QMetry services with the non-root user using docker commands?

This article helps with the commands that can be used for monitoring the services to ensure the QMetry instance is up and running.

The below entities that are responsible for QMetry services to be running.

Service

Description

Service

Description

docker service

Responsible for running two docker containers having the QMetry's tomcat application server and MySQL DB. So, if this service is not running - the QMetry instance would not be accessible

docker container "qmetry_app_1"

This container has a tomcat application server where the QMetry app is deployed. If this container is not running, that would mean the QMetry web application would not be accessible.

docker container "qmetry_rds_1"

This container has MySQL database services. If this container is not running, would also mean the QMetry web app would not be accessible.

Commands to monitor QMetry services

1. To monitor docker services

systemctl status docker | grep Active:

2. To monitor qmetry_app_1 container is up

docker container top qmetry_app_1 | grep tomcat

3. To monitor qmetry_rds_1 container is up

docker container top qmetry_rds_1 | grep mysql

Adding access of non-root users to execute docker commands

The non-root users may not be run the above docker commands. In those cases a docker user group needs to be created on the server, and users who need to execute the docker commands need to be added as a part of this group.

1. Create a docker group on the server

2. Add user to this group, replace "testuser" with the actual user who needs to run the above commands.

This way all docker related commands would be accessible to non-root users.