https://github.com/misskecupbung/monitbot-tele
Simple Bot Telegram to Monitor Website, Database and Ping Server.
https://github.com/misskecupbung/monitbot-tele
bot cron notification telegram
Last synced: about 1 year ago
JSON representation
Simple Bot Telegram to Monitor Website, Database and Ping Server.
- Host: GitHub
- URL: https://github.com/misskecupbung/monitbot-tele
- Owner: misskecupbung
- License: gpl-3.0
- Created: 2020-09-10T04:42:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-10T05:32:14.000Z (almost 6 years ago)
- Last Synced: 2025-01-01T13:42:14.828Z (over 1 year ago)
- Topics: bot, cron, notification, telegram
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# monitbot-telegram
This guide is refered from https://github.com/matriphe/monit2telegram/ . Goals:
* Monitoring database, website and ping.
* If fails, it will send notification via bot.
### Requirements
* Bot Telegram , you can create from eg: @botfather. Remember the token!
* Curl
* Bash
* JQ
* Cron
### Chat ID
```
$ curl --silent "https://api.telegram.org/bot{TOKEN}/getUpdates" | jq
```
### Deployment
```
cd /opt
git clone https://github.com/misskecupbung/monitbot-telegram
cd monitbot-tele
vim tokenbot
...
TOKEN={{ Telegram Bot Token }}
CHATID={{ Chat ID }}
...
#If you want to custom token path, you must edit :
vim monitbot-tele/telegramrc
...
elif [ -f /path/custom ]; then . /path/custom;
...
```
### Testing
```
chmod +x pingcheck && ./pingcheck
chmod +x dbcheck && ./dbcheck
chmod +x httpcheck && ./httpcheck
```
## Cron
We use cronjob for monitoring everyday. Eg: if every 3 minutes website don't give a response, it will send notification via bot to telegram :
```
crontab -e
...
*/3 * * * * /opt/monitbot-tele/httpcheck
*/3 * * * * /opt/monitbot-tele/dbcheck
*/3 * * * * /opt/monitbot-tele/pingcheck
...
```