monocker icon indicating copy to clipboard operation
monocker copied to clipboard

Missing exited state

Open sy6sy2 opened this issue 5 months ago • 9 comments

Monocker seems to be able to notify if a container is stopped or removed but I am not able to have this feature working.

My docker compose:

services:
  monocker:
    image: petersem/monocker:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

Steps to reproduce:

  1. docker compose up monocker
  2. Wait 1 minute
  3. docker compose down any existing stack (let's say homepage)
  4. Wait 1 minute, nothing appear in monocker log (I expect to have an exited log line)
  5. docker compose up homepage
  6. As expected I have the running log line in monocker log

Logs:

monocker-1  | ---------------------------------------------------
monocker-1  |  Monocker - MONitor dOCKER container states
monocker-1  |  Developed by Matt Petersen - Brisbane Australia
monocker-1  |  Donate: https://www.paypal.com/paypalme/thanksmp
monocker-1  |
monocker-1  |  Version: 2.13.7
monocker-1  | ---------------------------------------------------
monocker-1  |
monocker-1  | Settings
monocker-1  |      - Version: 2.13.7
monocker-1  |      - Messaging platform:
monocker-1  |      - Polling period: 10 seconds
monocker-1  |      - Only offline state monitoring: false
monocker-1  |      - Only include labelled containers: false
monocker-1  |      - Do not monitor 'Exited': false
monocker-1  |      - Disable Startup Messages: false
monocker-1  |      - Display SHA ID: false
monocker-1  | ---------------------------------------------------
monocker-1  |
monocker-1  | Monitoring started
monocker-1  |      - Currently monitoring 25 (running) containers
monocker-1  |      - monocker-monocker-1: running (healthy)
monocker-1  |      - homepage-homepage-1: running

Thank you

sy6sy2 avatar Sep 01 '25 09:09 sy6sy2

@sy6sy2 what environment variables have you set?

petersem avatar Sep 01 '25 09:09 petersem

None, because the default values seems to suite my needs (I will add Slack later)

sy6sy2 avatar Sep 01 '25 09:09 sy6sy2

None, because the default values seems to suite my needs (I will add Slack later)

Try these 3

Image

petersem avatar Sep 01 '25 09:09 petersem

Same problem with my new docker compose file:

services:
  monocker:
    image: petersem/monocker:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      MESSAGE_PLATFORM: 'slack@xxxxxxxxxx@xxxxxxx'
      ONLY_OFFLINE_STATES: 'false'
      EXCLUDE_EXITED: 'false'
      PERIOD: 30
      DISABLE_STARTUP_MSG: 'true'

sy6sy2 avatar Sep 01 '25 09:09 sy6sy2

@sy6sy2 are you getting any messages in slack? Perhaps try another platform or double check slack keys in monocker.

Is working for me with discord.

Image

Image

petersem avatar Sep 01 '25 10:09 petersem

Yes, I correctly get messages on Slack (the same messages that I get on monocker stdout). Only problem is that monocker seems to miss "exited" state change.

sy6sy2 avatar Sep 01 '25 11:09 sy6sy2

@sy6sy2 so if you stop a running container, nothing displays?

petersem avatar Sep 01 '25 11:09 petersem

Yes, this is my issue. If I "down" a docker compose stack nothing display. But after the "down" if I "up" the stack then I get the "running" event in both mono docker logs and Slack.

sy6sy2 avatar Sep 01 '25 11:09 sy6sy2

Hi, @petersem Thanks for useful service. I fixed missing notifications when container status becomes exited. Please, merge and update docker image in docker hub.

varemel avatar Nov 07 '25 03:11 varemel