If an http host is listed, the default request is ```HEAD /favicon.ico HTTP/1.1``` since this is usually a very fast, easy operation for the server. If a specific file or uri is requested, that will be requested instead, i.e. http://github.com/cnlohr will request ```HEAD /cnlohr HTTP/1.1```.
If a regular hostname is requested instead, ICMP (regular ping) will be used.
This allows cnping to be operated in environments where ICMP is prohibited by local computer or network policies.
## Installation
### Ubuntu
```
sudo apt install libxinerama-dev libxext-dev libx11-dev build-essential mesa-common-dev libglvnd-dev
git clone https://github.com/cntools/cnping.git
cd cnping/
git submodule update --init --recursive
make linuxinstall
```
'linuxinstall' builds the tool, copies it to your /usr/local/bin folder, and sets the cap_net_raw capability allowing it to create raw sockets without being root.
```
sudo cp cnping /usr/local/bin/
sudo setcap cap_net_raw+ep /usr/local/bin/cnping
```
Note that if only http pinging is requested, you do not need cap_net_raw or root access.
### Windows
A Windows-exe can be cross compiled on Linux, just install the necessary dependencies and compile it:
```
sudo apt install binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686
make cnping.exe
```
### Other distributions
See our Wiki page for information on more distributions, e.g. Arch, Void, Gentoo or Fedora: [Binary packages and distributions](https://github.com/cntools/cnping/wiki/Binary-packages-and-distributions)
================================================
FILE: cnping.1
================================================
.TH CNPING 1 "Dec 2020" "version 1.0" "User Manuals"
.SH "NAME"
cnping \- Minimal Graphical IPv4 Ping/HTTP Ping Tool
.SH "SYNOPSIS"
.B cnping cnping [host] [period] [extra size] [y-axis scaling] [window title]
.SH "DESCRIPTION"
.B cnping
is a minimal graphical real time IPv4 ping tool written in C.
It can send pings via ICMP (regular ping) or HTTP which is useful
in case ICMP is prohibited. Responses are displayed as vertical bars
in a graphical window. Red bars indicate a response was not (yet)
received, white bars indicate the response was received with a height
relative to the round trip time. Additional statistics are displayed
as an overlay.
.SH "OPTIONS"
All options can be passed either positional or as flags.
.IP -h
domain, IP address of ping target for ICMP or http host, i.e. http://google.com
.IP -p
period in seconds (optional), default 0.02
.IP -s
ping packet extra size (above 12), optional, default = 0
.IP -y
use a fixed scaling factor instead of auto scaling (optional)
.IP -t
the title of the window (optional)
.SH "GUI"
.IP q
quit
.IP m
toggle histogram mode
.IP f
toggle histogram frame mode
.IP c
reset histogram data
.SH "AUTHOR"
Charles Lohr cnping is a minimal graphical real time IPv4 ping tool written in C. It can send pings via ICMP (regular ping) or HTTP which is useful in case ICMP is prohibited. Responses are displayed as vertical bars in a graphical window. Red bars indicate a response was not (yet) received, white bars indicate the response was received with a height relative to the round trip time. Additional statistics are displayed as an overlay.
cnping uses rawdraw so it is OS independent and very light weight.