Skip to content

Simple Python that monitors website status and sends notifications to Telegram and or Microsoft Teams.

Notifications You must be signed in to change notification settings

selloween/pymonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram and MS Teams Site Monitor Bot

A simple Python script that checks availabilty of multiple sites and sends error alerts to Telegram and/or Microsoft Teams.

Basic configuration

Copy config_sample.py to config.py and edit accordingly.

Add sites and web services to be monitored

# config.py
sites = [
  "www.google.com",
  "www.twitter.com"
]

Activate messengers

# config.py
clients = {
  "msteams" = False,
  "telegram" = True
}

Telegram

Create new Telegram Bot

Get ChatID

Example JSON Responce:

chat: {
  "id": "XXXXXXXXX",
  "title": "my_group_name",
  "type": "group"
}
  • Set Telegram client to True in config.py
  • Add Telegram Bot Token and Chat ID
# Telegram
tg_token = ""
tg_chat_id = ""

Microsoft Teams

  • Add Teams webhook to config.py
msteams_webhook="XXXXXXXXXXXXXX"

Run Script

python monitor.py

Setup Cronjob

Setup a cronjob that runs the script every 5 minutes.(Change script location accordingly) Edit /etc/crontab and add following Line:

*/5 * * * * root python /opt/sitemap/monitor.py

About

Simple Python that monitors website status and sends notifications to Telegram and or Microsoft Teams.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages