Skip to content
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

Add telegram integration to the monitor_oracle.sh script #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/monitor-oracle.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash

VALIDATOR="<KUJIRAVALOPERADDRESS"
VALIDATOR="<KUJIRAVALOPERADDRESS>"
LCD="<http://YOUR-ENDPOINT:1317>"

# create your slack integration: https://api.slack.com/apps
SLACK_WEBHOOK="<http://YOUR-SLACK-WEBHOOK-ENDPOINT>"

# create you rown Telegram API https://core.telegram.org/bots/api
TELEGRAM_BOT_TOKEN="<TELEGRAM_API_TOKEN>"
CHAT_ID="<TELEGRAM_CHAT_ID>"

NOW=`date '+%F_%H:%M:%S'`;
echo "$NOW Starting oracle-monitoring script..."

Expand Down Expand Up @@ -34,6 +38,11 @@ while (true); do
TEXT="$TEXT\nlast logs:\`\`\`$LOGS\`\`\`"

curl -X POST -H 'Content-type: application/json' --data '{"text":"'"$TEXT"'"}' $SLACK_WEBHOOK

# telegram integration
# curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage?chat_id=$CHAT_ID&text=$TEXT"


fi
done;

Expand Down