Suggestion to add a Telegram notification #138
Replies: 3 comments 2 replies
-
I wonder does it make sense to implement this via logger: |
Beta Was this translation helpful? Give feedback.
-
In my opinion, this is out of scope. |
Beta Was this translation helpful? Give feedback.
-
@glensc yes, I think this is fancy functionnality and should not be coded inside this project. The plextraktsync script is supposed to work on a regular basis (every X hours) so in my opinion users need to be notified if it does NOT run correctly. #!/bin/sh
telegram_token='9138xxxxx:ALDc9rlEdfzciPZCNId3xbLRTtOexxxxxxx'
telegram_chat_id='-3211xxxx'
text='PlexTraktSync : Sync failure'
hour=$(date +"%H")
docker start ptsync
sleep 5m
exit_code=$(docker inspect ptsync --format='{{.State.ExitCode}}')
if [ $exit_code -ne 0 ] && [ $hour -gt 8 ] && [ $hour -lt 22 ] ; then
curl -s -X POST https://api.telegram.org/bot$telegram_token/sendMessage -d chat_id=$telegram_chat_id -d text="$text" > /dev/null
fi |
Beta Was this translation helpful? Give feedback.
-
First, thank you a million for you're very useful program!!!
I like to know if the script is running ok, so I created this small script that will send a Telegram notification.
Note that you need to create a Telegram Bot (really easy to do!), and get your Bot_Id and Chat_Id.
So I've created a "telegram_main.py" file that I'll use in the "plex_trakt_sync.sh" with the following content:
Hope that could help some! ;-)
Beta Was this translation helpful? Give feedback.
All reactions