Hi All,
i made a telegram script to report hash rates and other stats using telegram bot, the stats consists of power draw, temperature and fan speed on my little mining rig.
the code below, i got the command from older posts, currently the hash rates obtained from claymore or other miner that supports web-api, this script only works for claymore, can be modified if you are using ewbf, other stats is miner agnostic obtained from nvidia-smi
#!/bin/bash
# Telegram Info Script
# By BaliMiner et al...
# for nvOC by fullzero
# ref: http://bernaerts.dyndns.org/linux/75-debian/351-debian-send-telegram-notification
#
CHATID=
APIKEY=
CURRENTHASH=`/usr/bin/curl -s http://localhost:3333 | sed '/Total/!d; /Speed/!d;' | awk '{print $6}' | awk 'NR == 3'`
TEMP=$(/usr/bin/nvidia-smi --query-gpu=temperature.gpu --format=csv)
PD=$(/usr/bin/nvidia-smi --query-gpu=power.draw --format=csv)
FAN=$(/usr/bin/nvidia-smi --query-gpu=fan.speed --format=csv)
LF=$'\n'
PROFIT=$(cat /home/m1/current-profit)
MSG="Current Hashrate = "$CURRENTHASH" "$TEMP$LF$PD
/usr/bin/curl -s -X POST --output /dev/null https://api.telegram.org/bot${APIKEY}/sendMessage -d "text=${MSG}" -d chat_id=${CHATID}
put the script on crontab and specify how often you wanted the report ex: 5 mins, then put this on your crontab
*/5 * * * * /home/m1/telegram-info
dont forget to chmod 700 on the script to make it executable
Hope this script helps...
any suggestion is appreciated
