Skip to content

Monitoring Docker Container at Host Level

Auto-discover Docker containers on a host and get alerted when one stops unexpectedly.

4 min read Updated SS

HEAL can monitor the Docker containers running on a host at the host level. Once configured, the Component Agent automatically discovers all containers on the host and reports their status to the HEAL UI. If a container exits or stops unexpectedly, the change is captured in the Docker Ps Exited and Docker Ps Running KPIs, so you can configure alerts for timely detection and resolution.

Setting this up takes four phases: apply a SQL migration to the HEAL database, map the two Docker KPIs in Control Center, deploy the producer script on the Docker host, and verify the KPI data in the HEAL UI.

Prerequisites#

  • The Component Agent is installed and running on the Docker host you want to monitor.
  • You have Control Center access with permission to edit metric mappings for the target service.
  • You have connection details (host, port, and credentials) for the HEAL Percona database.
  • The migration SQL files and the Docker_ps_status.sh producer script are delivered with the HEAL release package. If you do not have them, contact HEAL Support at support@healsoftware.ai.

Deploy the SQL migration#

The migration registers the Docker status check in the HEAL Percona database (the appsone schema). It is packaged as a standard up/down migration pair:

  • 20250620094609-add-check-docker-status-script.up.sql
  • 20250620094609-add-check-docker-status-script.down.sql

  • On the HEAL server, navigate to the migration directory:

    cd a1home/Appsone_Service/migrate-db/appsone
    
  • Copy both SQL files (delivered with the HEAL release package) into this directory.

  • From the migrate-db directory, run the migration against the HEAL Percona database, substituting your database host, port, and password:

    env 'MIGRATION-DIR=./appsone' SUBNAME=//<ip>:<port>/appsone username=dbadmin password='<password>' java -jar migrate-db.jar --migrate
    
  • Confirm the command completes without errors before moving on to KPI mapping.

Map the KPIs in Control Center#

The migration adds two host-level KPIs — Docker Ps Exited and Docker Ps Running — which must be mapped to the instances you want to monitor.

  1. Log in to Control Center.
  2. From the home page, select the account, then navigate to Setup > Monitoring > Services.
  3. In the Setup Services page, search for the service whose instance runs on the Docker host and click it — for example, an OpenSearch service.
  4. In the Manage Service page, click the kebab menu (⋮) and, under the Edit Host section, click Metric Details.
  5. In the Edit Metric Details page, search for the two Docker KPIs: Docker Ps Exited and Docker Ps Running. Under the Mapped to Instance column, their status initially shows No.
  6. Select both KPIs so you can map them in one bulk action, then click Bulk Actions > Edit Details.
  7. In the Edit Details page, turn on the toggle under the Map/Unmap Metric section to map the selected instances, then click Save.
  8. Confirm the mapping succeeded: the Mapped to Instance status for both KPIs now shows Yes.

Deploy the producer script#

The Docker_ps_status.sh producer script runs on the Docker host. It enumerates the containers on the host and reports their running and exited status through the Component Agent, so an unexpected container stop is forwarded to the HEAL UI. The script is delivered with the HEAL release package — contact HEAL Support at support@healsoftware.ai if you need it.

  1. On the Docker host, navigate to the Component Agent producers folder — for example:

    cd /home/ComponentAgent/producers
    
  2. Copy Docker_ps_status.sh into this folder and make sure it is executable.

  3. Restart the Component Agent so it picks up the new producer.

Note

Containers are auto-discovered — you do not need to register individual containers. Any container that starts on the host is reflected in the KPI data automatically.

Verify in the UI#

  1. Log in to the HEAL UI.
  2. Select the account, click Services, and open the application pod that contains the service running on the Docker host.
  3. In the application summary, click the specific service — for example, the OpenSearch service.
  4. In the Service Details page, check the Health Summary section: the Docker container status appears as Docker ps Status. Click the KPI pod to open the KPI data.
  5. Review the two KPI graphs:
    • Docker Ps Exited — lists the containers that have stopped on the host.
    • Docker Ps Running — lists the containers currently running on the host.
  6. To be notified when a container stops unexpectedly, configure an alert on the Docker Ps Exited KPI.

Next