Sign inSign up

xanubi/monit-slack

By xanubi

•Updated over 8 years ago

Monitor Containers for Health checks, and send SLACK messages when is down.

Image
1

10K+

xanubi/monit-slack repository overview

⁠Introduction

Monitor Containers for Health checks, and send Slack Notifications, when Containers Run Into Problems/down.

⁠General Idea

Start a container in the target docker host. This container will query status for all containers. curl -XGET --unix-socket /var/run/docker.sock http://localhost/containers/json

Send slack notifications, we get matched of "unhealthy"

NOTE: This image is based on Python Alpine image, and scanned for vulnerabilities with anchore.io

⁠How To Use: Plain Container

Create a .env file and a docker-compose.yml file, put both on the same directory.

⁠The .env file:
SLACK_CHANNEL=XXX
SLACK_USERNAME=XXX
SLACK_TOKEN=xoxp-XXX-XXX-XXX-XXXXXXXX
MSG_PREFIX=Monitoring On XX.XX.XX.XX

 

⁠The Docker-compose file
version: '3'
services:
  monit-slack:
    container_name: monitslack
    restart: always
    image: xanubi/monit-slack:latest
    environment:
      SLACK_CHANNEL: ${SLACK_CHANNEL}
      SLACK_USERNAME: ${SLACK_USERNAME}
      SLACK_TOKEN: ${SLACK_TOKEN}
      MSG_PREFIX: ${MSG_PREFIX}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

 

⁠Security

This image is continuous scanned by Anchor.io, for security bugs. You can check it at anchore.io : https://goo.gl/ZhQRra⁠

 

⁠Conclusion

And that's it. You can add this to your docker composer file of your project, and your containers are health checked.

Tag summary

Content type

Image

Digest

Size

36.5 MB

Last updated

over 8 years ago

docker pull xanubi/monit-slack