Monitoring your services with uptime-kuma and integrating telegram for notification.

March 07, 2023
I now had 16 containers running across my home lab. and I needed a mechanism to get notified if simply some of the services were dead. 
I decided on uptime-kuma, for it being dead-simple to add in and operate. 
# Simple docker-compose.yml
# You can change your port or volume location

version: '3.3'

services:
  uptime-kuma:
    image: louislam/uptime-kuma:1
    container_name: uptime-kuma
    volumes:
      - ./uptime-kuma-data:/app/data
    ports:
      - 3002:3001  # <Host Port>:<Container Port>
    restart: always

Note: You can see that I am using 3002 port for uptime kuma, Usually people use 3001 but I have my own weekan app hosted there. 

docker-compose up -d
You can check if the uptime kuma is up or not by following command. 
docker-compose ps
Now, You can go to url : In my case it was http://192.168.86.32:3002 .
Screenshot 2023-03-07 at 19.12.12.png 153 KB

You can add in services by selecting http and ports are accepted as well. Be carefull of http or https , As some of my services were not using ssl.

Now if any added service goes down. You might want to add in the a notifier. I chose telegram. 

So go to telegram. Find botfather and give ```/newbot```
The botfather would guide through rest of process of adding in name of the bot and the username.
Screenshot 2023-03-07 at 21.33.34.png 39.5 KB

Go to Kuma settings and under notification add in telegram , You would need to add in API TOKEN and chat id ,
Screenshot 2023-03-07 at 21.34.46.png 184 KB

For Chat ID , it can be auto grabbed, But you would need to say hi to your newly created bots first.

Now if any container is stopped it will send you notifications in your telegram.
Screenshot 2023-03-07 at 21.35.45.png 64.3 KB