x11tete11x / watchdog-ping

A tiny script to see test if some IP is alive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

watchdog-ping

A tiny script to watch if some IP is alive

Requirements:

  1. A working DB, in my case i use MariaDB. You need to create the following database:
CREATE DATABASE <DBNAME>;
USE <DBNAME>;
CREATE TABLE ping(id INT unsigned NOT NULL AUTO_INCREMENT, ip VARCHAR(15), status VARCHAR(10), tx INT UNSIGNED, rx INT UNSIGNED, percent_lost INT UNSIGNED, min FLOAT, avg FLOAT, max FLOAT, mdev FLOAT, PRIMARY KEY (id),ts timestamp default current_timestamp);
  1. If you need mail notify, you need to configure it and replace it in the code of the script

Install:

  1. Clone it:
git clone https://github.com/x11tete11x/watchdog-ping.git
  1. Make executable
chmod +x /path/to/script/watchdog-ping.sh
  1. You can put in cron, to execute periodically, for example every 5 minutes
crontab -e
*/5 * * * * /path/to/script/watchdog-ping.sh

About

A tiny script to see test if some IP is alive


Languages

Language:Shell 100.0%