Find online hosts in own subnet, serve results as JSON over HTTP
- Crude demo-hack, written entirely in Shell-script
- Runs without dependencies in Alpine Linux-container
- Does network host discovery using ICMP Echo (ping) and filters responding hosts.
(NOTE: ICMP echo-replies must be enabled,
net.ipv4.icmp_echo_ignore_all=0
) - Single shell script for ICMP flooding, "web-server" + JSON encoding (host-disco/icmp_discov_httpd.sh)
- Serves output as JSON over HTTP ("web server" runs on port 1500 by default), example-output:
{ "hosts": [ "172.24.0.1", "172.24.0.4", "172.24.0.3", "172.24.0.5", "172.24.0.2" ] }
- MQTT server aka mosquitto
- MQTT clients aka client-1 & client-2
- ICMP host-discovery-service aka host-disco (see host-disco/icmp_discov_httpd.sh)
Ignore the MQTT server and clients, they are only included to have hosts to discover.
The scripts run-test.sh
/run-test.cmd
demonstrates this, by starting all services and then gradually stopping them again.
Running the script demonstrates the host-discovery service responding to changes approximately within a second.