A simple network monitoring daemon that provides a quick overview of service availability via ICMP ping, TCP/UDP ports, or HTTP/HTTPS.
The original project was Java-based — Argus. I worked on it as a playground to explore Java 25 features, and at some point needed AI help, and then decided... why not translate it to C++, back to the roots, so to speak.
I liked the result of the translation and decided to continue with the C++-based project.
The program exposes an endpoint and serves a static (configurable) HTML page:
- Multi-Protocol: Ping (ICMP, raw sockets, and calling the ping utility; the homemade ping implementation is still suffering from some issues); TCP/UDP port connectivity (TCP connect, UDP by sending an empty packet), HTTP/HTTPS (sending GET requests; ignores certificates)
- IPv4/IPv6: I tried to make it work with both v4 and v6, but I have somewhat limited networks to truly test this
- Web Dashboard: Apart from the API endpoint, the program also serves HTML; the contents are configurable. Obviously, it's possible to place an HTML file with any contents on any other web server. One template (glass-tty.html) uses the Glass TTY VT220 font (public domain) embedded as base64
- Deployment: Foreground, background/daemonized, SysV, systemd, FreeBSD rc.d, Solaris SMF — I've done my best to support these
- Logging: Uses spdlog library. Default is stdout/stderr and /var/log/argus.log
- C++ compiler — I tried to use certain C++23 features, but compilers have different support for this standard, so in practice, C++20 should be enough for now
- CMake (no specific version requirements)
- OpenSSL, systemd development libraries — detected and linked during the build
- httplib, spdlog — downloaded and statically linked during the build process
There are a couple of tricks during the build process
cmake -S src -B build/ && cmake --build build/ -j$(nproc)
There is only one set of tests — detecting if an address is IPv4 vs IPv6
cmake --build build/ -j$(nproc) --target check
Just run ./build/bin/argus
— the tool will print out the available command-line arguments. To try it out, the simplest way is to run something like:
./build/bin/argus config/example_config.json
argus argus.json # stdout logging
argus -l /tmp/debug.log argus.json # file logging
argus -d argus.json # daemon + default log file
argus -d -l /custom/path.log argus.json # daemon + custom log file
argus -s argus.json # systemd mode
argus -s -l /custom/path.log argus.json # systemd mode + custom log file
Note: Argus supports configuration hot-reload using the SIGHUP signal:
# Send SIGHUP signal to reload configuration
kill -SIGHUP <pid>
# or using systemctl for systemd services
sudo systemctl reload argus
When processing SIGHUP, Argus reloads both the configuration and HTML dashboard.
{
"name": "My Network Monitor",
"listen": "127.0.0.1:8080",
"log_file": "/var/log/argus.log",
"cache_duration_seconds": 30,
"thread_pool_size": 8,
"monitors": [
{
"sort": 1,
"group": "Critical Services",
"destinations": [
{
"sort": 1,
"name": "Google DNS",
"timeout": 3000,
"warning": 2,
"failure": 3,
"reset": 2,
"interval": 60,
"history": 100,
"test": {
"method": "Ping",
"host": "8.8.8.8"
}
}
]
}
]
}
name
: Display name for this monitor instancelisten
: Web interface bind address (IP:port or just port)log_file
: Log file path (optional, overrides defaults)ping_implementation
: Ping method -"system_ping"
or"unprivileged_icmp"
cache_duration_seconds
: Web page cache duration in seconds (default: 30, set to 0 to disable caching)thread_pool_size
: Number of worker threads for monitoring (default: 0 = auto-calculate based on hardware and monitor count)
sort
: Display ordergroup
: Group name for organizationdestinations
: Array of monitoring targets
name
: Display name for this destinationtimeout
: Test timeout in millisecondswarning
: Consecutive failures before warning statusfailure
: Consecutive failures before failure statusreset
: Consecutive successes needed to reset from warning/failureinterval
: Test interval in secondshistory
: Number of results to keep in memory
ICMP Ping
{
"method": "Ping",
"host": "hostname_or_ip"
}
TCP/UDP Port Check
{
"method": "Connect",
"protocol": "TCP",
"host": "hostname_or_ip",
"port": 80
}
HTTP/HTTPS Endpoint
{
"method": "URL",
"url": "https://example.com/health"
}
Depending on the Linux/UNIX/BSD flavor, ping functionality might not work. ICMP or raw sockets require some sort of elevated rights:
# Enable unprivileged ICMP sockets (requires root)
sudo sysctl -w net.ipv4.ping_group_range="0 65535"
# Make persistent across reboots
echo 'net.ipv4.ping_group_range = 0 65535' | sudo tee -a /etc/sysctl.conf
# Allow raw sockets for argus
sudo setcap cap_net_raw+ep argus
I've tried to maintain installation guides in SERVICES.md and HowToRun.md, but overall:
cmake --install
should do the trick depending on your environment. My personal preference is to install it in /opt/argus
and maintain etc/
and bin/
directories there. Since the tool statically links with httplib and spdlog, this works well for me.