Go to file
2023-10-04 19:11:32 +02:00
nix removed default from nix and added an example instead 2023-10-04 19:11:32 +02:00
outage_detector renamed variables 2023-10-04 18:39:47 +02:00
.envrc initial commit 2023-08-15 23:13:14 +02:00
.gitignore finished and working 2023-08-19 17:44:50 +02:00
flake.lock initial commit 2023-08-15 23:13:14 +02:00
flake.nix finished and working 2023-08-19 17:44:50 +02:00
poetry.lock finished and working 2023-08-19 17:44:50 +02:00
pyproject.toml finished and working 2023-08-19 17:44:50 +02:00
README.md typo 2023-10-04 17:46:48 +02:00

Outage Detector

This script pings a host and logs whether a connection could be established. It then can also extract the major outages from these logs. It is mainly used as a tool for statistical analysis of residential internet connections.

Usage

The program has two subcommands.

log

Get the current connection status to the default host (1.1.1.1) and timeout (2).

$ outage_detector log
> [YYYY-MM-DD HH:MM:SS][1.1.1.1][OK]

Or use a custom host and timeout with

$ outage_detector log --host 1.0.0.1 --timeout 4
> [YYYY-MM-DD HH:MM:SS][1.1.1.1][FAIL]

To append a log to outages.log. Will create the file if it does not exist. This will suppress output to stdout.

$ outage_detector log outages.log --host 1.0.0.1 --timeout 4
> [YYYY-MM-DD HH:MM:SS][1.1.1.1][FAIL]

outages

Print the major outages to stdout.

$ outage_detector log outages.log
> [YYYY-MM-DD HH:MM:SS][1.1.1.1] lasting for 3 Minutes

You can also specify the time in minutes a connection loss should count as an outage. Default is 3 Minutes.

$ outage_detector log outages.log --time 6
>