Skip to content

Commit 44de68a

Browse files
committed
docs: update readme with tons of small things
1 parent 337d954 commit 44de68a

File tree

1 file changed

+155
-13
lines changed

1 file changed

+155
-13
lines changed

README.md

Lines changed: 155 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![GitHub language count](https://img.shields.io/github/languages/count/PlexSheep/netpulse)
77
[![Rust CI](https://github.com/PlexSheep/netpulse/actions/workflows/cargo.yaml/badge.svg)](https://github.com/PlexSheep/hedu/actions/workflows/cargo.yaml)
88

9-
Keep track of your internet connection with a daemon
9+
Keep track of your internet connection with a daemon. Licensed under MIT.
1010

1111
- [GitHub](https://github.com/PlexSheep/netpulse)
1212
- [crates.io](https://crates.io/crates/netpulse)
@@ -17,6 +17,56 @@ Keep track of your internet connection with a daemon
1717
My ISP has trouble pretty much every year some month delivering constant uptime,
1818
Netpulse helps keep track of when your internet connectivity goes down.
1919

20+
## Platform Support
21+
22+
- Primary support: GNU/Linux x86_64
23+
- Other architectures: May work but untested
24+
- Windows: Not supported
25+
- macOS: Unknown/untested
26+
27+
I have it running on my homeserver and laptop with Debian based modern Operating
28+
Systems.
29+
30+
## How it Works
31+
32+
Netpulse performs comprehensive connectivity checks using multiple methods:
33+
34+
1. HTTP Checks: Makes HTTP requests to test application-layer connectivity
35+
2. ICMP Checks: Sends ping requests to test basic network reachability
36+
3. Dual-Stack: Each check is performed over both IPv4 and IPv6 to monitor both network stacks
37+
38+
The daemon performs these checks every 60 seconds against reliable targets
39+
(currently Cloudflare's DNS servers). This multi-protocol approach helps
40+
distinguish between different types of connectivity issues.
41+
42+
## Installation
43+
44+
### Via Cargo
45+
46+
The simplest way to install Netpulse is through Cargo:
47+
48+
```bash
49+
cargo install netpulse
50+
```
51+
52+
This will install both the `netpulse` and `netpulsed` executables.
53+
54+
### System Setup
55+
56+
After installing the binaries, you'll need to set up the daemon environment:
57+
58+
```bash
59+
sudo netpulsed --setup
60+
```
61+
62+
This will:
63+
64+
- Create the netpulse user and group
65+
- Copy the `netpulsed` executable to `/usr/local/bin/`
66+
- Create necessary directories and set permissions
67+
- Install a systemd unit file
68+
- Configure logging
69+
2070
## Usage
2171

2272
Netpulse has two parts:
@@ -34,32 +84,124 @@ seconds.
3484

3585
### The Daemon
3686

37-
The daemon of Netpulse can be started, ended and so on with the `netpulsed`
38-
executable.
87+
The `netpulsed` daemon can be run either through systemd (recommended) or as a standalone process.
3988

40-
A simple `sudo netpulsed --start` will let the daemon run until you stop it or
41-
your system shuts down. Root privileges are required for starting and setup,
42-
but privileges will be dropped to the user `netpulse` with the group
43-
`netpulse`.
89+
#### Using Systemd (Recommended)
4490

45-
To set everything up, including a systemd unit file, a user, and copying the `netpulsed`
46-
executable to `/usr/local/bin/`, do the following:
91+
After running the setup (`sudo netpulsed --setup`), you can manage the daemon using standard systemd commands:
4792

4893
```bash
49-
netpulsed --setup
94+
sudo systemctl start netpulsed.service # Start the daemon
95+
sudo systemctl stop netpulsed.service # Stop the daemon
96+
sudo systemctl status netpulsed.service # Check daemon status
5097
```
5198

52-
#### Updating
99+
#### Running Standalone
100+
101+
You can also run `netpulsed` directly as a regular program. Note that root privileges are required for setup, but the daemon will drop privileges to the `netpulse` user and group during operation.
53102

54-
Just run `netpulsed --setup` again, and restart the systemd service with
55-
`systemctl restart netpulsed.service` if you use that.
103+
#### Logging
104+
105+
The daemon's log level can be controlled using the `NETPULSE_LOG_LEVEL` environment variable. Valid values are:
106+
107+
- `error`
108+
- `warn`
109+
- `info` (default)
110+
- `debug`
111+
- `trace`
112+
113+
For example:
114+
115+
```bash
116+
NETPULSE_LOG_LEVEL=debug netpulsed --start
117+
```
56118

57119
### The Reader
58120

59121
You can use `netpulse --test` to run the checks the daemon would run and see the
60122
status. Just using `netpulse` without arguments will result in it trying to load
61123
and analyze the store.
62124

125+
#### Example Output
126+
127+
The processed output of `netpulse` currently looks somewhat like this:
128+
129+
```txt
130+
========== General =======================================
131+
checks : 00303088
132+
checks ok : 00302357
133+
checks bad : 00000731
134+
success ratio : 99.76%
135+
first check at : 2024-11-09 00:38:00 +01:00
136+
last check at : 2025-01-07 01:18:00 +01:00
137+
138+
========== HTTP ==========================================
139+
checks : 00150190
140+
checks ok : 00149890
141+
checks bad : 00000300
142+
success ratio : 99.80%
143+
first check at : 2024-11-09 00:38:00 +01:00
144+
last check at : 2025-01-07 01:18:00 +01:00
145+
146+
========== ICMP ==========================================
147+
checks : 00152898
148+
checks ok : 00152467
149+
checks bad : 00000431
150+
success ratio : 99.72%
151+
first check at : 2024-11-09 03:19:00 +01:00
152+
last check at : 2025-01-07 01:18:00 +01:00
153+
154+
========== IPv4 ==========================================
155+
checks : 00151544
156+
checks ok : 00151371
157+
checks bad : 00000173
158+
success ratio : 99.89%
159+
first check at : 2024-11-09 00:38:00 +01:00
160+
last check at : 2025-01-07 01:18:00 +01:00
161+
162+
========== IPv6 ==========================================
163+
checks : 00151544
164+
checks ok : 00150986
165+
checks bad : 00000558
166+
success ratio : 99.63%
167+
first check at : 2024-11-09 00:38:00 +01:00
168+
last check at : 2025-01-07 01:18:00 +01:00
169+
170+
========== Outages =======================================
171+
None
172+
173+
========== Store Metadata ================================
174+
Hash mem blake3 : a4a4a6e3fac92ecce6e2e11a82d6b22552ad373ec49086007263d770aa36158d
175+
Hash file sha256 : 804cc9de8714dd19d732fafd54fb4fe188e7053fa24434810fbd86f86cee0fcb
176+
Store Version (mem) : 2
177+
Store Version (file) : 2
178+
Store Size (mem) : 16777248
179+
Store Size (file) : 1112087
180+
File to Mem Ratio : 0.06628542416491667
181+
```
182+
183+
### Updating
184+
185+
There are two steps to updating Netpulse:
186+
187+
1. Update the binaries:
188+
189+
```bash
190+
cargo install netpulse
191+
```
192+
193+
2. Update the system configuration:
194+
195+
```bash
196+
sudo netpulsed --setup
197+
```
198+
199+
3. If using systemd, restart the service:
200+
201+
```bash
202+
sudo systemctl restart netpulsed.service
203+
```
204+
63205
### Files and Directories
64206

65207
`netpulsed` will try to create a few directories / files:

0 commit comments

Comments
 (0)