Skip to content
lubeschaninPublic

About

The Ping-Status App is a web application that fetches and displays information about the online status of hostnames within a specified DNS zone. The app allows users to view the hostnames that were never online, hostnames created today, and the ping status of all hostnames in the DNS zone.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Ping-Status App

A small self-contained monitoring dashboard: it fetches all A records of a DNS zone via zone transfer (AXFR), pings every host on a schedule and shows the current status in a web dashboard — plus a JSON API with CSV export.

Dashboard

Features

  • Dashboard (single page, dark theme, zero external dependencies — no CDN, works in offline networks): KPI tiles (total / online / unreachable / never online / new today), three tabs, live search, sortable columns (IPs sort numerically), status pills, pagination, auto-refresh every 60 s
  • Status-change log: only real transitions (online ↔ unreachable) are persisted — the database stays tiny (a few hundred KB) no matter how long the app runs
  • JSON API with ?format=csv on every list endpoint (UTF-8 BOM, opens cleanly in Excel), interactive docs via Swagger at /docs
  • Health endpoint including disk usage

API

Endpoint Description
GET /api/results Current ping status per host/IP pair
GET /api/hosts/today Hostnames first seen today
GET /api/hosts/never_online Hosts that never had a single successful ping
GET /api/changes?limit=200 Latest status transitions, newest first
DELETE /api/hosts/never_online Remove those hosts (they reappear on the next round while still in DNS)
GET /health Status + disk usage

How it works

python main.py starts two processes: a uvicorn web server and a scheduler loop. Each round the scheduler transfers the zone, pings all hosts concurrently (bounded by a semaphore) and records the round in a single SQLite transaction:

  • hostnames — every hostname ever seen, with created_at
  • current_status — exactly one row per host/IP pair (status, last checked, last online)
  • status_changes — append-only log of real transitions only

SQLite runs in WAL mode so both processes can work concurrently. The code avoids INSERT … ON CONFLICT DO UPDATE on purpose — it works on SQLite 3.22+ (e.g. Ubuntu 18.04).

Setup

Requires Python 3.9+ and a DNS server that allows zone transfers (AXFR) for the machine running the app — see Windows DNS server config.md for a Windows DNS example.

python3 -m venv venv
./venv/bin/pip install -r requirements.txt
# edit app.config in main.py: dns_server, dns_zone, server_ip
./venv/bin/python main.py

Then open http://<server_ip>:8000.

More screenshots (hostnames redacted): new hosts · never online

License

GPLv2 — see LICENSE.

About

The Ping-Status App is a web application that fetches and displays information about the online status of hostnames within a specified DNS zone. The app allows users to view the hostnames that were never online, hostnames created today, and the ping status of all hostnames in the DNS zone.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages