Go to file
2024-01-01 00:46:57 +01:00
nix Changed name of binary 2023-10-13 13:56:55 +02:00
src renamed source directory 2023-10-13 15:20:28 +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 updated flake to use out of tree poetry 2024-01-01 00:25:38 +01:00
flake.nix formatting 2024-01-01 00:46:57 +01:00
poetry.lock finished and working 2023-08-19 17:44:50 +02:00
pyproject.toml renamed source directory 2023-10-13 15:20:28 +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
>