-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telegram notifications / change stdout ? #113
Comments
For anyone asking the same question and myself for future reference, here's what I did: I installed telegram.sh and configured it with my Telegram token and my Chat ID. Then I edited the btrfsmaintenance configuration file:
Finally I edited the btrfsmaintenance script I use (only btrfs-scrub in my case):
I'm really not sure it's safe to modify these files, as they could be modified in a future update. Make a backup of your modifications! Any other possibility to implement Telegram notifications is very welcome, as this is probably far to be ideal. |
I'm not sure if there is another standard way to redirect output on a system-wide logging level, adding it into the maintenance scripts is possible but it could be the wrong place. If you need it just for one of the services then it needs another configuration option. Also for telegram it would require the external script due to the access token, but this is fine as you say above. |
Hello,
I'm not sure if this is the right place to ask, sorry if it's not.
Is there a way to get Telegram notifications? I would like to receive results of my monthly scrubs on it.
I've tried to modify BTRFS_LOG_OUTPUT in /etc/default/btrfsmaintenance like this but it didn't work:
BTRFS_LOG_OUTPUT="curl -s -X POST https://api.telegram.org/bot<MyTelegramToken>/sendMessage -d chat_id=<MyChatID> -d text="TEST NOTIFICATION""
Even if it works, is it possible to have two BTRFS_LOG_OUTPUT entries, one for stdout and one for Telegram? Or is it the wrong way to go anyway?
Any help would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: