A repository to define a Telegram Bot for handling alerts emitted by a Big Brother installation
-
Talk to Telegram's Bot Father, create your own bot and get it's Telegram Token;
-
Open a Dialogflow account, create a new project and import the configs from the folder
bot/dialogflow
; -
Setup a Telegram integration on Dialogflow with the Token obtained in
step 1
; -
Send messages to your bot on telegram and then train your intents on Dialogflow website;
-
Expose your
port 3000
and inform a reachable HTTPS address to the Dialogflow fulfillment configuration. We recommend using ngrok for that; -
Type the following commands in your terminal to interact with your bot directly through Telegram:
TELEGRAM_TOKEN=<XXXXX:YYYYYY> docker-compose up -d --build
This will run an example app with its own
bb-promster
cluster and the Big Brother app with its components. -
Now go to the bot on Telegram, and add a new App. Inform the App name (e.g.
Example
) and the app address (e.g.example-bb-promster:9090
). You'll be automatically subscribed to the app you've just added.
The example client app bb-promster
cluster will get registered to the Big Brother's ETCD and Big Brother will then start collecting metrics by federating it.
Also, access http://localhost:3000/test
on your browser to dispatch test alerts and see if you get them at your Telegram chat.
It's possible to configure a basic auth to provide security to the API:
- Set the environment variable
BASIC_AUTH_USERNAME
with the value of the desired username - Set the environment variable
BASIC_AUTH_PASSWORD
with the value of the desired password
Now, to complete an API request is necessary to have a basic auth with valid credentials. If these environment variables weren't set, the authentication is not required.
This is part of a more large application called Big Brother.