Crates.io | netpulse |
lib.rs | netpulse |
version | 0.5.1 |
source | src |
created_at | 2024-11-08 19:36:25.431605 |
updated_at | 2024-11-11 00:42:44.177338 |
description | Keep track of if your internet is still alive, collect stats against a crappy ISP |
homepage | https://github.com/PlexSheep/netpulse |
repository | https://github.com/PlexSheep/netpulse |
max_upload_size | |
id | 1441491 |
size | 141,774 |
Keep track of your internet connection with a daemon
My ISP has trouble pretty much every year some month delivering constant uptime, Netpulse helps keep track of when your internet connectivity goes down.
Netpulse has two parts:
netpulsed
– A daemon that is supposed to run all the time on your server
/ machine that should keep track of your internet connectionnetpulse
– A Tool that can read and analyze the store, which contains the
checks made by netpulsed
To use Netpulse, you need to let the daemon netpulsed
run for a while, and
then you can read out the data with netpulse
.
Basically, netpulsed
will try to make HTTP requests to a few targets every 60
seconds.
The daemon of Netpulse can be started, ended and so on with the netpulsed
executable.
A simple sudo netpulsed --start
will let the daemon run until you stop it or
your system shuts down. Root privileges are required for starting and setup,
but privileges will be dropped to the user netpulse
with the group
netpulse
.
Therefore, you need to create a user netpulse
on your system to use the
daemon:
useradd -r -s /usr/sbin/nologin netpulse
To set everything up, including a systemd unit file and copying the netpulsed
executable to /usr/local/bin/
, do the following:
netpulsed --setup
Just run netpulsed --setup
again, and restart the systemd service with
systemctl restart netpulsed.service
if you use that.
You can use netpulse --test
to run the checks the daemon would run and see the
status. Just using netpulse
without arguments will result in it trying to load
and analyze the store.
netpulsed
will try to create a few directories / files:
/run/netpulse/netpulse.pid
– lockfile with the PID of the daemon to make sure it doesn't run multiple times/var/lib/netpulse/netpuse.store
– the database where your checks are stored/var/log/netpulse.log
– contains the stdout of the daemon/var/log/netpulse.err
– contains the stderr of the daemonThe target IPs with which checks are made are defined in the constant TARGETS
here.
Currently, it boils down to 1.1.1.1
(cloudflare's DNS server), and the
respective IPv6 adress of that.