Monitoring a docker container

Hi Team,
I am running a Docker container which is now pushing logs into Graylog using GELF. But i would like to get an alert when the particular container is not working (exit, deleted, stopped, etc).

If you can find it in the logs you are shipping in, you can parse out the alert. Hard to help without knowing your environment, what messages you are seeing, how you are handling them, what you have tried… here are some tips for filling out more information.

1 Like

When my docker container is stoped it will send log “exited with code 0” But this log is not showing in my Graylog, It will stop before the exit status logs.

I have tracked the logs in Graylog input (GELF UDP)-> Show reeived messages. But could not find the last docker container exists status message on Graylog

Environmental information
Docker containerized Graylog system.
DockerHost: Ubuntu 14.04.3 LTS

Package versions
mongo:4.2
Elasticsearch : docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
graylog/graylog:4.2

So containers are sending all logs to my Graylog system just fine, but when a container goes down, logs are not visible on Graylog. I’m currently monitoring my Docker container and would like to receive an alert if it goes down.

To make sure you having timing right, It would make sense to monitor the container externally to see if it is up or alert if it was down… Any logs internal tot he container should flow from cutoff point after the container is back up…

@tmacgbay
Regarding the time my application and Graylog exists on the same docker host, moreover, i can see all the logs till the container showing

myapplication_docker_container_name exited with code 0

Does this happen within the container that is shutting down or is it happening on the host machine?

That is the docker container log, means happening inside the container.

You will have to catch/alert that externally - I doubt there is enough time from the container saying it’s stopped to get the last message out.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.