Answer the question
In order to leave comments, you need to log in
How to configure smartd to send to telegram on centos7?
Please tell me how to configure smartd to send to telegram on centos7
There are a lot of examples on the net, but they are all for ubuntu. For centos, not only are the paths drastically different, it's also not clear how to adapt the tutorials, since the custom scripts for sending notifications are different:
start_smartd=yes
smartd_opts="--interval=1800"
DEVICESCAN -H -m root -M test -M exec /usr/libexec/smartmontools/smartdnotify -n standby,10,q
#! /bin/sh
# Send mail
echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
# Notify desktop user
MESSAGE="SMART Disk monitor:"
case "$SMARTD_FAILTYPE" in
"EmailTest"|"Health"|"Temperature"|"Usage")
;;
*)
# "CurrentPendingSector", // 10
# "OfflineUncorrectableSector", // 11
# "FailedReadSmartErrorLog", // 7
# "ErrorCount", // 4
# "FailedReadSmartData", // 6
# "FailedHealthCheck", // 5
# "FailedOpenDevice", // 9
# "SelfTest", // 3
# "FailedReadSmartSelfTestLog", // 8
exit 0
esac
# direct write to terminals, do not use 'wall', because we don't want its ugly header
for t in $(who | awk '{ print $2; }' | grep -e '^tty' -e '^pts/')
do
echo "$MESSAGE
$SMARTD_MESSAGE" >/dev/$t 2>/dev/null ||:
done
/usr/share/smartmontools/smartd-runner
/etc/smartmontools/run.d/
/etc/smartmontools/smartd_warning.d/
/etc/smartmontools/smartd_warning.sh
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question