Device Monitor - a tool for automatic network device monitoring and detection

Started by hacesoft, January 02, 2026, 01:01:40 PM

Previous topic - Next topic

Hello everyone! 👋
I've created my first OPNsense plugin:
https://github.com/hacesoft/opnsense-devicemonitor

And would like to share it with you. It's called Device Monitor - a tool for automatic network device monitoring and detection.
What the plugin does:

🔍 Automatic network device scanning (ARP + DNS)
📊 Online/offline status display
🔔 Email notifications for new device detection
🏷� Manufacturer identification using OUI database
📈 Dashboard with device overview

Technical details:

Python daemon with configurable scan interval
MVC architecture following OPNsense standards
REST API for control
Czech and English translations

The plugin is fully functional, but definitely not perfect. I would love to hear your feedback:

What could I improve?
What features would be useful?
Where did I make mistakes or violate best practices?
Any suggestions for improvements!

I'm open to constructive criticism and looking forward to your insights. Thanks for your time! 🙏

Looks interesting, and remembers me on NetalertX.

Few questions here:
QuoteRequirements

    1. OPNsense 24.x or newer
    2. Working SMTP configuration (System → Settings → Notifications)
    3. SSH access enabled (System → Settings → Administration → Secure Shell)
    4. Root password

2. Working SMTP configuration (System → Settings → Notifications)
Would it be possible to have as well notifications via webhook e.g to support ntfy instances?


3. SSH access enabled (System → Settings → Administration → Secure Shell)
4. Root password
Does this work only with a Root account? Or does this work with any active admin account with proper permissions?

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
N355 - i226-V | AQC113C | 16G | 500G - PROD

PRXMX
N5105 - i226-V | 2x8G | 512G - NODE #1
N100 - i226-V | 16G | 1T - NODE #2

Hello,

there is a new hostdiscovery service on the OPNsense roadmap that uses a rust written daemon that captures arp and ndp messages via pcap to build a database of known devices.

https://github.com/opnsense/hostwatch

https://github.com/opnsense/core/pull/9354

So something comparable is a core feature soon and integrated into a few components like aliases and captive portal.

So as feedback, you could use the existing sqlite database of the hostwatch service since its in core anyway if you want your own GUI around it.
Hardware:
DEC740

Quote from: Seimus on January 02, 2026, 01:27:06 PMLooks interesting, and remembers me on NetalertX.

Few questions here:
QuoteRequirements

    1. OPNsense 24.x or newer
    2. Working SMTP configuration (System → Settings → Notifications)
    3. SSH access enabled (System → Settings → Administration → Secure Shell)
    4. Root password

2. Working SMTP configuration (System → Settings → Notifications)
Would it be possible to have as well notifications via webhook e.g to support ntfy instances?


3. SSH access enabled (System → Settings → Administration → Secure Shell)
4. Root password
Does this work only with a Root account? Or does this work with any active admin account with proper permissions?

Regards,
S.

Good day, it definitely wouldn't be a problem to use a webhook to send data instead of email notifications. I have something similar planned at home, where I will be sending data to a protocol center that I have on my NAS in BSD format (RFC 3164). I have the ROOT account disabled on the firewall, and I have my own Admin account on which the plugin works nicely.

Quote from: Monviech (Cedrik) on January 02, 2026, 01:29:13 PMHello,

there is a new hostdiscovery service on the OPNsense roadmap that uses a rust written daemon that captures arp and ndp messages via pcap to build a database of known devices.

https://github.com/opnsense/hostwatch

https://github.com/opnsense/core/pull/9354

So something comparable is a core feature soon and integrated into a few components like aliases and captive portal.

So as feedback, you could use the existing sqlite database of the hostwatch service since its in core anyway if you want your own GUI around it.

Have a nice day, it's not yet :), so I'll use my own solution. My plugin can even display devices that don't have an IP address :). And in the DHCP settings, 'Deny unknown clients' is enabled, then I only get the MAC address, which is what I wanted :). And to send the result by email :). If the future add-on works the same or even better, I'll use that, for now I have this :).

Quote from: Seimus on January 02, 2026, 01:27:06 PMWould it be possible to have as well notifications via webhook e.g to support ntfy instances?


Have a nice day, I added support for webhook, ntfy and custom

Quote from: hacesoft on January 03, 2026, 07:39:28 PMI added support for webhook, ntfy and custom
Wow thanks!

Regards,
S.
Networking is love. You may hate it, but in the end, you always come back to it.

OPNSense HW
N355 - i226-V | AQC113C | 16G | 500G - PROD

PRXMX
N5105 - i226-V | 2x8G | 512G - NODE #1
N100 - i226-V | 16G | 1T - NODE #2

Wow this is amazing!
thanks for creating and sharing this tool. I'll Give it a try.


Version 2.0 is released today. Completely redesigned :). And it already looks usable :).

Hi,

Nice tool, not perfect yet but provides a good overview.

But what doesn't seem to work at all is the hostname, which is always unfilled?


Steffen

I would like to see this software rolled into one plugin together with the device discovery service added to OPNsense recently. There's some overlap in functionality.

Then again, unless the information is accumulated over a multi-layer network, i.e. across routers, I could just as well query the network management software for it. I can see how filtering MACs into FW Aliases can be useful if one manages networks on the basis of MAC addresses, but I don't.

Quote from: SteffenDE on April 20, 2026, 03:16:58 PMHi,

Nice tool, not perfect yet but provides a good overview.

But what doesn't seem to work at all is the hostname, which is always unfilled?


Steffen

Hi Steffen,
The hostname field works as follows: the plugin pulls the hostname from Services → ISC DHCPv4 / DHCPv6 → DHCP Static Mappings — specifically the Hostname field for each entry. If a device doesn't have a static mapping with a hostname defined there, the field will simply remain empty, as the plugin has no other automatic source for this information.
You can also fill in the hostname manually directly in the plugin, but note that this is stored only in the plugin's own database — it does not propagate back to OPNsense DHCP or any other system.
So the short answer: populate the Hostname field in your DHCP static mappings and it will appear automatically.

Quote from: mooh on April 21, 2026, 03:30:38 PMI would like to see this software rolled into one plugin together with the device discovery service added to OPNsense recently. There's some overlap in functionality.

Then again, unless the information is accumulated over a multi-layer network, i.e. across routers, I could just as well query the network management software for it. I can see how filtering MACs into FW Aliases can be useful if one manages networks on the basis of MAC addresses, but I don't.

The primary motivation for building this plugin was notifications — automatically alerting me (via email or webhook) whenever a new or unknown device appears on the network. That's the core value-add, and it's something OPNsense still doesn't provide natively. Everything else — custom hostnames, clickable URLs, having it all in one place — is convenience on top of that.
An important part of the plugin is also device identification — it works on several levels: hostname (pulled from DHCP static mappings, or filled in manually by the admin), a custom admin note, and vendor identification resolved from the MAC address prefix (OUI lookup). This has been part of the plugin since v1.0.
Regarding merging with the native discovery service: Device Monitor v2.0 already builds directly on the hostwatch database (/var/db/hostwatch/hosts.db), so that overlap has been intentionally addressed. Interestingly, hostwatch didn't exist at all when I started writing the plugin — it was added somewhere between v1.0 and v2.0, and I was happy to take advantage of it. The plugin no longer does its own ARP/tcpdump scanning. A nice case of the platform catching up mid-project. 🙂
On your multi-layer network point: you're right — like hostwatch itself, this plugin only sees devices on directly connected segments. For deeper topologies a dedicated NMS like LibreNMS or Zabbix would be the proper tool. This plugin targets setups where OPNsense is the network edge.
Not every plugin is for everyone — install what fits your needs. 🙂

Quote from: hacesoft on April 21, 2026, 06:38:33 PMHi Steffen,
The hostname field works as follows: the plugin pulls the hostname from Services → ISC DHCPv4 / DHCPv6 → DHCP Static Mappings — specifically the Hostname field for each entry. If a device doesn't have a static mapping with a hostname defined there, the field will simply remain empty, as the plugin has no other automatic source for this information.

As far as I can see what you call the Hostname is in fact the Description field in my Dnsmasq Hosts and not the Hostname.