From 89b05ef0bcc6f38f7f792c53abf498b846bbcc20 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Sat, 20 Nov 2021 23:10:00 -0700 Subject: [PATCH] Blah. --- projects/aloe/README.md | 76 +++++++++++++++++++++++ projects/aloe/src/python/aloe/__main__.py | 4 +- 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/projects/aloe/README.md b/projects/aloe/README.md index bdbb7d5..269e059 100644 --- a/projects/aloe/README.md +++ b/projects/aloe/README.md @@ -11,6 +11,82 @@ Aloe uses multiple threads to first establish a rough network topology via ICMP ``` sh $ bazel build //projects/aloe $ sudo ./bazel-bin/projects/aloe/aloe twitter.com google.com +INFO:__main__:Graph - + ┌─────────────────┐ + │ 127.0.0.1 │ + └─────────────────┘ + │ + │ + ▼ +┌─────────────────┐ ┌─────────────────┐ +│ 68.85.107.81 │ ◀── │ 10.0.0.1 │ +└─────────────────┘ └─────────────────┘ + │ │ + │ │ + │ ▼ + │ ┌─────────────────┐ + │ │ 68.85.107.85 │ + │ └─────────────────┘ + │ │ + │ │ + │ ▼ + │ ┌─────────────────┐ + │ │ 68.86.103.9 │ + │ └─────────────────┘ + │ │ + │ │ + │ ▼ + │ ┌─────────────────┐ + └───────────────────▶ │ 68.85.89.213 │ + └─────────────────┘ + │ + │ + ▼ + ┌─────────────────┐ + │ 24.124.155.129 │ + └─────────────────┘ + │ + │ + ▼ +┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ +│ 96.110.43.241 │ ◀── │ 96.216.22.130 │ ──▶ │ 96.110.43.253 │ +└─────────────────┘ └─────────────────┘ └────────────────┘ + │ │ │ + │ │ │ + ▼ ▼ ▼ +┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ +│ 96.110.38.114 │ │ 96.110.43.245 │ │ 96.110.38.126 │ +└─────────────────┘ └─────────────────┘ └────────────────┘ + │ │ │ + │ │ │ + ▼ ▼ ▼ +┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ +│ 96.87.8.210 │ │ 96.110.38.118 │ │ 23.30.206.218 │ +└─────────────────┘ └─────────────────┘ └────────────────┘ + │ │ │ + │ │ │ + ▼ ▼ ▼ +┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ +│ 108.170.252.193 │ │ 173.167.57.142 │ │ 172.253.75.177 │ +└─────────────────┘ └─────────────────┘ └────────────────┘ + │ │ │ + │ │ │ + ▼ ▼ ▼ +┌─────────────────┐ ┌─────────────────┐ ┌────────────────┐ +│ 142.250.69.238 │ │ 213.155.133.171 │ │ 142.250.72.46 │ +└─────────────────┘ └─────────────────┘ └────────────────┘ + │ + │ + ▼ +┌─────────────────┐ ┌─────────────────┐ +│ 104.244.42.65 │ ◀── │ 62.115.49.193 │ +└─────────────────┘ └─────────────────┘ + │ + │ + ▼ + ┌─────────────────┐ + │ 104.244.42.129 │ + └─────────────────┘ ``` If hosts in topology stop responding for 10s or more (the polling interval is ~1s), they are declared to be warning. diff --git a/projects/aloe/src/python/aloe/__main__.py b/projects/aloe/src/python/aloe/__main__.py index fb8e4ea..540a787 100644 --- a/projects/aloe/src/python/aloe/__main__.py +++ b/projects/aloe/src/python/aloe/__main__.py @@ -183,10 +183,10 @@ if __name__ == "__main__": f"DEAD\t{res.address}\t{timestamp.isoformat()}\t{delta.total_seconds()}\n" ) - elif last and delta < recovered: + elif last and delta < recovered_duration: fp.write(f"WARN\t{res.address}\t{timestamp.isoformat()}\n") - elif last and delta > recovered: + elif last and delta > recovered_duration: fp.write(f"DOWN\t{res.address}\t{timestamp.isoformat()}\n") except queue.Empty: