vergoh / vnstat-docker

vnStat in a container with image output via http
https://humdi.net/vnstat/
MIT License
88 stars 12 forks source link

Add Telegram monthly summary #18

Open tabacman86 opened 3 weeks ago

tabacman86 commented 3 weeks ago

Hi, Thank you for this container!

May I ask to add a monthly summary over Telegram to get the summary in a push?

Thanks!

vergoh commented 1 week ago

Could you clarify your request; are you looking for some new style of monthly output which would be the "monthly summary" (text or image?) or having some kind of Telegram support in the current container?

Regardless of which one of those (or even if it's not either), what kind of behaviour / configurability did you also have in mind or how would the usage flow work?

tabacman86 commented 1 week ago

Hi,

It would be great to have a monthly summary in a text message over Telegram, including the tx,rx, and total bandwidth. Additionally, we need a 'listener' feature that can 'push' the notification at the beginning of every month for the previous month's data. For example, on July 1st, I will get the monthly summary for June.

For configuration, the container should have the following ENVs:

  1. TELEGRAM_ALLOWED_ID - the chat ID the bot allows to send messages and push the notification.
  2. TELEGRAM_API_KEY - the API key of the bot that is sending this type of message
vergoh commented 4 days ago

Currently there aren't any plans on adding push notifications to vnStat directly. As for the container, it would probably make more sense to use the current container image as base and then extend with some cron capable service and the tooling necessary for sending push notifications to whichever messaging services are wanted.

However, the catch here is that usually these sort of solutions are better developed and maintained by someone actually using those messaging services (and Telegram wouldn't likely be the only one "nice to have"). As a result, I'm gravitating towards declining this feature request but I could still provide some implementation pointers if necessary from vnStat's point of view and if a suitable output can't be generated from vnStat's current options then such could be added.