Sunday, October 18, 2020

Connect Check


Recently internet reliability issues lead to a desire to monitor and log uptime to get an idea of how much down time there actually was.  Initially there didn't seem to be any particular correlation between incidents of lost connectivity and things like time of day or usage patterns.  Hence the need to log some data put some parameters around the problem.

A straightforward method to do this is to create a bash script that uses ping to test access to various external sites.
Some general requirements:
-- The ping responses are logged to a log file.
-- The failed ping responses are additionally logged to a separate file to easily identify problems.
-- The external locations to contact can be configured.
-- Script runs automatically at startup.

This is running as a systemd service on a CentOS 7 minimal installation.
The script and associated files can be found at https://github.com/cajanssen/connectcheck