Skip to content

Include hostname in shoutrrr notifications #717

Answered by svengo
svengo asked this question in Q&A
Discussion options

You must be logged in to vote

I solved the problem myself using docker-compose on-board tools: First I put HOSTNAME=docker-prod01 in the .env file, then I used the environment variable in docker-compose.yml:

version: '2.3'

services:
  watchtower:
    image: containrrr/watchtower
    userns_mode: "host"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - TZ=Europe/Berlin
      - WATCHTOWER_POLL_INTERVAL=28800      # 8 hours
      - WATCHTOWER_CLEANUP=true
      - "WATCHTOWER_NOTIFICATION_TEMPLATE={{range .}}${HOSTNAME}: {{.Message}}{{println}}{{end}}"
      - WATCHTOWER_NOTIFICATIONS=shoutrrr
      - WATCHTOWER_NOTIFICATION_URL=telegram://SECRET_TOKEN@telegram?channels=CHANNEL_ID
    

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@simskij
Comment options

Answer selected by svengo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants