Go to file
Kristian Krsnik 6f62e88a96
typo
2023-10-04 17:46:48 +02:00
nix added new command line interface 2023-10-04 17:39:03 +02:00
outage_detector added new command line interface 2023-10-04 17:39:03 +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
README.md typo 2023-10-04 17:46:48 +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

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
>