Skip to content

dog1912/ping-and-notifications-to-telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Router ping and notification in private messages via telegram bot

Installation

  1. Download the necessary files or clone this project anywhere.
git clone https://github.com/dog1912/ping-and-notifications-to-telegram.git
  1. Add your domain name or ip address for the router to the ping.sh script files. For convenience, you can add an entry in the hosts:
8.8.8.8 host1
1.1.1.1 host2
  1. Edit the value of TOKEN and "chat id channel" to send a notification to telegram
TOKEN="Token bot from telegram"
TARGETS=([host1]="chat id channel" [host2]="chat id channel")
  1. Add the task to the crontab with flock to prevent re-runs. Instead of /scripts/ you need to specify your path
*/1 * * * * flock -n /var/tmp/host1.lock -c "/scripts/ping.sh host1"  >/dev/null 2>&1
*/1 * * * * flock -n /var/tmp/host2.lock -c "/scripts/ping.sh host2"  >/dev/null 2>&1

Feedback

Feel free to send bug reports and feature requests. If you are using this solution in production, please tell me to know it's being useful.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages