A tool to monitor devices connected to a network.
This application has three main parts.
This is an always-running background service which uses nmap to query the local network to check for currently connected devices. After each query, this service does a few things:
- Adds new connected devices to a local SQLite database
- Updates the last connected time to now for previously-connected devices
- Optionally, notify users of newly connected devices and previously-connected devices which require notifying
- Currently, only email notifications (to and from your own email) are supported
This is a Falcon REST API for access to the connected devices.
This is a simple React UI to view current and previously connected devices, as well as make basic edits to them (provide user-friendly names, configure which devices require notifications).
This assumes you already have Python, Node, and NPM installed.
First, download nmap here.
After downloading this repo or cloning it, start a Python virtual environment and install requirements.txt:
Windows:
python -m venv venv
.\venv\Scripts\activate
python -m pip install -r requirements.txt
Linux:
python -m venv venv
. venv/bin/activate
python -m pip install -r requirements.txt
Next, in /Service, rename template.env to email.env and update the email and password to your desired email and the base64 hash of it's password. This will be the email which sends and receives emails.
Next, in the project root folder, open settings.py and update the path of your nmap installation. If it's part of your path, you can just put 'nmap'.
Next, go to web/src/services/backendservice.ts and update this.apiUrl to your computers' local IP address. Do not change the port.
Finally, open three terminals in the project base folder and run each application separately (ensure the API and Service are ran in venv):
- Service:
cd .\service\
python .\main.py
- API:
cd .\api\
python .\main.py
- Web:
cd .\web\
npm install
npm run dev
I dunno, it was just fun to build.
This could be extended or used to do things like:
- Add more notification events, such as executing an Alexa skill, or sending some sort of API request to turn on a smart home device
- Store statistics on how long devices were connected to a network
- Home security (ensure strangers are not using your wifi)
- Figure out a better way to run all three portions at once/in one command
- Better mobile display
- Ensure everything can be hosted on a device on a network and accessed from other devices (i.e. not just localhost)
- Ensure Linux works
- Some devices can appear connected on one query, then disconnected on the next, over and over. It would be cool to implement a buffer/debounce (only notify if connected after being disonnected for 3 queries, etc)


