Skip to content

PingGraph is a simple terminal program that pings multiple hosts and shows the results. It asks the user to enter the hostnames or IP addresses and prints them on the screen. Later it will show response times and a live ASCII graph.

License

Notifications You must be signed in to change notification settings

FeldherrWeiprecht/PingGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c5b62c6 · · Jul 20, 2025

History

21 Commits
Jul 20, 2025
Jul 18, 2025
Jul 18, 2025
Jul 20, 2025
Jul 20, 2025
Jul 20, 2025
Jul 18, 2025
Jul 20, 2025
Jul 20, 2025

Repository files navigation

PingGraph Logo

PingGraph

Description

PingGraph is a terminal based C program that continuously measures and visualizes the network latency (ping) to multiple hosts.
It displays a live bar graph in the console, tracks statistics and supports machine readable exports..

How It Works

  1. Pings each host once per interval or just once (--once).
  2. Parses and extracts the latency from the system ping command.
  3. Visualizes the latency using a color coded ASCII bar.
  4. Tracks min / max / average latency and timeouts for each host.
  5. Logs results to a file or exports as JSON/CSV on demand.
  6. Displays a final summary if requested.

Features

  • Interactive or file based host input.
  • Live bar graph with latency color codes.
  • JSON output (--json).
  • CSV export (--csv le>).
  • Interval mode (--interval N) or limited rounds (--limit N).
  • Summary view (--summary).
  • Timeout tracking.
  • ANSI color toggle (--no-color).
  • Log to file with append support (--log-append).

Requirements

  • A C compiler (GCC or MSVC).
  • POSIX compatible system or Windows.
  • System ping command available in PATH.

Usage

Compile:

gcc main.c -o pinggraph

Run with interactive input:

./pinggraph

Run with host file:

./pinggraph --hosts hosts.txt --interval 5 --summary

Print as JSON:

./pinggraph --once --json

Export as CSV:

./pinggraph --once --hosts hosts.txt --csv results.csv

Host File Format

Simple plain text file, one host per line:

8.8.8.8
cloudflare.com

Output Example

Example Image

Notes

  • Works best in a terminal that supports ANSI colors.
  • For consistent results, run with administrator/root privileges.
  • To stop the program during live execution, press Ctrl+C.

About

PingGraph is a simple terminal program that pings multiple hosts and shows the results. It asks the user to enter the hostnames or IP addresses and prints them on the screen. Later it will show response times and a live ASCII graph.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages