You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep track of your internet connection with a daemon
9
+
Keep track of your internet connection with a daemon. Licensed under MIT.
10
10
11
11
-[GitHub](https://github.com/PlexSheep/netpulse)
12
12
-[crates.io](https://crates.io/crates/netpulse)
@@ -17,6 +17,56 @@ Keep track of your internet connection with a daemon
17
17
My ISP has trouble pretty much every year some month delivering constant uptime,
18
18
Netpulse helps keep track of when your internet connectivity goes down.
19
19
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
+
20
70
## Usage
21
71
22
72
Netpulse has two parts:
@@ -34,32 +84,124 @@ seconds.
34
84
35
85
### The Daemon
36
86
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.
39
88
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)
44
90
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:
47
92
48
93
```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
50
97
```
51
98
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.
53
102
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
+
```
56
118
57
119
### The Reader
58
120
59
121
You can use `netpulse --test` to run the checks the daemon would run and see the
60
122
status. Just using `netpulse` without arguments will result in it trying to load
61
123
and analyze the store.
62
124
125
+
#### Example Output
126
+
127
+
The processed output of `netpulse` currently looks somewhat like this:
128
+
129
+
```txt
130
+
========== General =======================================
0 commit comments