Skip to content

Commit

Permalink
Add extra hosts feature
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-stroke committed Nov 15, 2024
2 parents 1d3e207 + fa2297b commit 216eeb1
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

A Python script to check internet uptime by pinging DNS servers.


## Prerequisites

For running with python, follow the below steps. Otherwise, I've also compiled it into an exe that you can point and click to run, so that is an alternative as well, though it might not be as consistent as the .py script. This has been tested to work on windows 10, 11, and Ubuntu.
For running with python, follow the below steps. Otherwise, I've also compiled it into an exe that you can point and click to run, though I recommend the .py script, since the .exe might not be as consistent as the original. This has been tested to work on windows 10, 11, and Ubuntu.

1. **Python**: Make sure Python is installed on your computer, version 3.10 or up
- Download from: https://www.python.org/downloads/ make sure to check the box that says to add it to your "PATH".
Expand All @@ -14,6 +15,9 @@ python --version
```

2. **Git** (Optional - Choose one method below):



- **With Git:**
- Install Git from: https://git-scm.com/downloads
- Clone:
Expand All @@ -22,8 +26,7 @@ git clone https://github.com/zero-stroke/uptime.git
```
- **Without Git:**
- Click the green "Code" button on GitHub
- Select "Download ZIP"
- Extract the ZIP file
- Select "Download ZIP", then extract the downloaded file

## Running the Script

Expand All @@ -41,23 +44,11 @@ It logs instances at which all three ping attempts are not successful and tracks
Output while running should look something like this:
```
Quad9 Cloudflare Google
2024-10-19 14:12:56 - ✅ 53.08 ms ✅ 51.03 ms ✅ 49.53 ms
2024-10-19 14:12:59 - ✅ 54.06 ms ✅ 48.04 ms ✅ 61.24 ms
2024-10-19 14:13:02 - ✅ 51.64 ms ✅ 49.06 ms ✅ 47.54 ms
2024-10-19 14:13:05 - ✅ 52.53 ms ✅ 48.53 ms ✅ 50.10 ms
2024-10-19 14:13:09 - ✅ 52.23 ms ✅ 49.17 ms ✅ 46.52 ms
2024-10-19 14:13:12 - ✅ 51.81 ms ✅ 48.03 ms ✅ 48.54 ms
2024-10-19 14:13:15 - ✅ 51.53 ms ✅ 48.02 ms ✅ 49.08 ms
2024-10-19 14:13:18 - ✅ 52.62 ms ✅ 48.02 ms ✅ 48.92 ms
2024-10-19 14:13:21 - ✅ 52.55 ms ✅ 48.54 ms ✅ 47.01 ms
2024-10-19 14:13:25 - ✅ 264.02 ms ✅ 62.03 ms ✅ 70.94 ms
2024-10-19 14:13:28 - ✅ 52.12 ms ✅ 48.03 ms ✅ 48.57 ms
2024-10-19 14:13:31 - ✅ 52.55 ms ✅ 66.36 ms ✅ 52.02 ms
2024-10-19 14:13:34 - ✅ 52.03 ms ✅ 48.51 ms ✅ 47.41 ms
2024-10-19 14:13:41 - ❌ ✅ 48.56 ms ✅ 47.54 ms
2024-10-19 14:13:44 - ✅ 51.51 ms ✅ 50.07 ms ✅ 48.00 ms
2024-10-19 14:13:47 - ✅ 71.09 ms ✅ 75.09 ms ✅ 71.58 ms
2024-10-19 14:13:50 - ✅ 52.67 ms ✅ 48.10 ms ✅ 48.03 ms
Host | Uptime | Average | Low | High
Expand Down Expand Up @@ -93,8 +84,7 @@ Ongoing outage since 2024-10-19 16:34:05
2024-10-19 16:34:30 - ✅ 53.58 ms ✅ 49.60 ms ✅ 47.72 ms
2024-10-19 16:34:33 - ✅ 52.66 ms ✅ 49.94 ms ✅ 46.73 ms
2024-10-19 16:34:36 - ✅ 56.55 ms ✅ 52.60 ms ✅ 58.75 ms
2024-10-19 16:34:39 - ✅ 52.66 ms ✅ 49.94 ms ✅ 46.73 ms
2024-10-19 16:34:42 - ✅ 56.55 ms ✅ 52.60 ms ✅ 58.75 ms


Host | Uptime | Average | Low | High
--------+--------+----------+----------+---------
Expand All @@ -109,6 +99,8 @@ Start | End | Duration
2024-10-19 16:33:24 | 2024-10-19 16:34:27 | 63.17s (1.05 minutes)
```

As it runs, it also writes the output to a .log file in the same directory that it was ran from.

You can also add your own hosts to ping by using the `--extra-hosts` or `e` flag when
it's ran in the command line, giving each host's address and name.
For example,
Expand All @@ -119,6 +111,7 @@ For example,

```uptime.exe -e 8.8.4.4 GoogleDNS 208.67.222.222 "Another Host"```


Note that if using Windows 10 or below, the emojis are replaced by [] and [X].


Expand All @@ -131,5 +124,9 @@ If you encounter issues:
- For help, create an issue on GitHub


If you find this tool useful, consider giving it a ⭐ on GitHub to help others discover it!



## License
This project is licensed under the Apache NON-AI License, Version 2.0 - see the [LICENSE](LICENSE.txt) file for details

0 comments on commit 216eeb1

Please sign in to comment.