Skip to content

A network monitor that detects and displays changes in your home network

License

Notifications You must be signed in to change notification settings

bkahlert/netmon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

60 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Netmon License Buy Me A Unicorn

About

Netmon is a network monitor that detects and displays changes in your home network.

It uses nmap to detect devices and additionally used mDNS and NetBIOS to resolve hostnames.

screenshot of the loading showing a Kaomoji wizard Loading screen

screenshot of Netmon showing a recent network scan with 13 online and 2 offline hosts Recent network scan

The application consists of three independent parts:

  • a JVM-based network scanner that publishes appearing and disappearing hosts using MQTT,
  • a Kotlin/JS and Fritz2 based web interface that display the results, by subscribing to MQTT, and
  • a Ansible-based installer that installs everyone on a Raspberry Pi (including the Pi 1 and Zero).

photo of Netmon running on a Raspberry Pi Zero Netmon on a Raspberry Pi Zero with an 7-inch screen

Find detailed installation instructions in ansible/README.md.

Development

Run locally

Run the scanner component locally

./gradlew runShadow

Run the web display component locally

./gradlew jsBrowserDevelopmentRun --continuous

Run remotely

If you installed Netmon on a Raspberry Pi, you can use the handy patch tool.

Just switch the directory, make patch executable, and set the HOST to work with:

cd ansible
chmod +x patch
export HOST=foo.local

Build and update the remote scanner component

SCANNER=1 ./patch

Build and update the remote web display component

WEB_DISPLAY=1 ./patch

Build and update the remote scanner and web display component

SCANNER=1 WEB_DISPLAY=1 ./patch

๐Ÿ’ก You can export your preferred settings, e.g. export SCANNER=1 WEB_DISPLAY=1 to only have to type ./patch.

MQTT

Publish a host event

BROKER_HOST=test.mosquitto.org BROKER_PORT=1883
mqtt pub -t "dt/netmon/test/en0/10.10.10.0/24/host" -m '{
    "event": "host",
    "type": "up",
    "host": {
      "ip": "10.10.10.10",
      "name": "test.local",
      "status": "up",
      "since": 1692455344
    }
}' -r -h "$BROKER_HOST" -p "$BROKER_PORT"

Subscribe to host events

BROKER_HOST=test.mosquitto.org BROKER_PORT=1883
mqtt sub -t dt/netmon/+/+/+/+/host -h "$BROKER_HOST" -p "$BROKER_PORT" -J

Delete a retained host event

BROKER_HOST=test.mosquitto.org BROKER_PORT=1883
mqtt pub -t "dt/netmon/test/en0/10.10.10.0/24/host" -m '' -r -h "$BROKER_HOST" -p "$BROKER_PORT"

Update MQTT.js

(cd mqtt.js && ./build.sh)

See mqtt.js/README.md for details.

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by making a PayPal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! ๐Ÿ™

License

MIT. See LICENSE for more details.