You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
1.7 KiB
117 lines
1.7 KiB
3 years ago
|
---
|
||
|
|
||
|
Alias: [""]
|
||
|
Tag: [""]
|
||
|
Date: 2022-03-10
|
||
|
DocType:
|
||
|
Hierarchy:
|
||
|
TimeStamp:
|
||
|
location:
|
||
|
CollapseMetaTable: Yes
|
||
|
|
||
|
---
|
||
|
|
||
|
Parent:: [[Selfhosting]], [[Server Alias]], [[Server Cloud]], [[Server Tools]], [[Server VPN]]
|
||
|
|
||
|
---
|
||
|
|
||
|
 
|
||
|
|
||
|
```button
|
||
|
name Save
|
||
|
type command
|
||
|
action Save current file
|
||
|
id Save
|
||
|
```
|
||
|
^button-ConfiguringTelegrambotsNSave
|
||
|
|
||
|
 
|
||
|
|
||
|
# Configuring Telegram bots
|
||
|
|
||
|
 
|
||
|
|
||
|
```ad-abstract
|
||
|
title: Summary
|
||
|
collapse: open
|
||
|
This note allows to configure Telegram bots for pairing with certain services.
|
||
|
```
|
||
|
|
||
|
 
|
||
|
|
||
|
```toc
|
||
|
style: number
|
||
|
```
|
||
|
|
||
|
 
|
||
|
|
||
|
---
|
||
|
|
||
|
 
|
||
|
|
||
|
### Linking services with a Telegram bot
|
||
|
|
||
|
 
|
||
|
|
||
|
#### Creating a Telegram Bot
|
||
|
|
||
|
1. In Telegram, look for '@BotFather'
|
||
|
2. Initialise with `/start`
|
||
|
3. Create bot with `/newbot`
|
||
|
|
||
|
Record the Token from the message from *BotFather*.
|
||
|
|
||
|
 
|
||
|
|
||
|
#### Getting the Bot's Chat ID
|
||
|
|
||
|
In a terminal, run:
|
||
|
|
||
|
```ad-command
|
||
|
title: Telegram Chat ID
|
||
|
~~~bash
|
||
|
curl https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates | jq .message.chat.id
|
||
|
~~~
|
||
|
```
|
||
|
|
||
|
|
||
|
 
|
||
|
|
||
|
#### Linking Logwatch
|
||
|
|
||
|
Please see full documentation [[GitHub - fxkjdlogwatch-telegram-bot Send logwatch results to your telegram account|here]].
|
||
|
|
||
|
 
|
||
|
|
||
|
#### Linking monit
|
||
|
|
||
|
Please see full documentation [[GitHub - matriphemonit2telegram A simple script to send Monit alerts using Telegram bot.|here]].
|
||
|
|
||
|
 
|
||
|
|
||
|
---
|
||
|
|
||
|
 
|
||
|
|
||
|
### Current bots
|
||
|
|
||
|
 
|
||
|
|
||
|
#### Logwatch and Monit
|
||
|
|
||
|
A bot has been created for [[Configuring Monit|monit]] and Logwatch.
|
||
|
|
||
|
 
|
||
|
|
||
|
```ad-credentials
|
||
|
title: Credentials
|
||
|
| Variable | Value
|
||
|
| - | -
|
||
|
| Name | Logwatch_servers
|
||
|
| Username | [mbvservers_bot](https://t.me/mbvservers_bot)
|
||
|
| Token | 5218097204:AAEnsZLTk4TTk-X-MceuoIGX0IQWLkngM4E
|
||
|
| Chat ID | 1622082350
|
||
|
```
|
||
|
|
||
|
 
|
||
|
 
|