First of all kudo's for this project. I had no monitoring, enabled your scripts for ZFS and hey presto 👍 .
However for smart it doesn't seem to work (or I did something wrong) or I'm not receiving anything although I have hooked up a disk that generates pending sectors/reallocated sectors.
root@nas:~# cat /root/telegramsystemnotifications/telegram_text.sh
#!/bin/bash
CHAT_ID='xxxxxxxxx'
API_KEY='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# Get the message from stdin, making the first line bold.
MESSAGE=$(cat -)
# Try to send a message; sleep a bit after each unsuccessful attempt.
until /usr/bin/curl -G \
--data-urlencode "parse_mode=Markdown" \
--data-urlencode "chat_id=${CHAT_ID}" \
--data-urlencode "text=${MESSAGE}" \
"https://api.telegram.org/bot${API_KEY}/sendMessage" >&/dev/null
do
sleep 10
done
A simple echo to the symlink sends a message so that seems to work.
(echo hello | /etc/smartmontools/run.d/10telegram)
First of all kudo's for this project. I had no monitoring, enabled your scripts for ZFS and hey presto 👍 .
However for smart it doesn't seem to work (or I did something wrong) or I'm not receiving anything although I have hooked up a disk that generates pending sectors/reallocated sectors.
Ubuntu 18.04.3 LTS Made a symlink to the script:
Script contains:
A simple echo to the symlink sends a message so that seems to work. (echo hello | /etc/smartmontools/run.d/10telegram)