Home

Network diagnosis

As sysadmins often need to diagnose networks, we need some good scripts to ease that task. This is a script that provides uniform interface to common tasks:

The following gives the example of each of above

$ ./network-diagnose latency gnu.org
--- gnu.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4067ms
rtt min/avg/max/mdev = 309.724/315.723/318.832/3.529 ms

$ ./network-diagnose http gnu.org
0.64

$ ./network-diagnose scan posixcafe.org
Starting Nmap 7.95 ( https://nmap.org ) at 2025-06-19 15:01 +0545
Nmap scan report for posixcafe.org (45.76.19.58)
Host is up (0.30s latency).
rDNS record for 45.76.19.58: mail.posixcafe.org
Not shown: 993 closed tcp ports (conn-refused)
PORT    STATE    SERVICE
17/tcp  filtered qotd
19/tcp  filtered chargen
25/tcp  open     smtp
80/tcp  open     http
443/tcp open     https
587/tcp open     submission
993/tcp open     imaps

Nmap done: 1 IP address (1 host up) scanned in 25.78 seconds

$ ./network-diagnose dns posixcafe.org
45.76.19.58