How a non -root user can get the status of the docker container for monitoring purposes?

This article helps with the commands and a Linux script file for monitoring the docker containers to ensure the QMetry instance is up and running.

The following commands need to be executed once as a “root” user to set up the script.

  1. Replace $USER with the actual username who is going to execute/monitor docker containers.

    sudo usermod -aG docker $USER
  2. Execute the below command to activate the changes to groups.

    newgrp docker
  3. Place the attached file anywhere on the host system and execute the following command.

    chmod +x qmetry_status.sh

Now, non-root Linux users can execute the “qmetry_status.sh” file which provides outputs of the docker container status for monitoring purposes.