r/learnpython • u/Terrible-Disaster774 • 2d ago
need to build a network performance monitoring tool
I hope this is perfect sub to post.
I need to build network performance monitoring and anomaly detection tool. I need to make something built with an admin dashboard and easy to set up , register a device and monitor easy to run on low resources.
the biggest challange is how to monitor and detect a registred device by an IP address(my be dynamic) is there any way?
which protocols i have to explore for detection and reporting ?
I'm a little bit familiar with python programming .
any advise or suggestion regarding workflow or implementation will be appreciated?
1
u/white-9igga 2d ago
for the dynamic ip thing, the usual trick is to flip it around, dont make your server go find the devices, make each device phone home. you put a small python script (or an agent like telegraf or node exporter) on each device that sends its stats to your server every 10-30 seconds with a device id or name that you register once, so the ip can change as much as it wants and you still know who is who. if a device stops reporting for a few minutes, thats your "down" alert.
for what to measure, ping (latency and packet loss), simple tcp connect checks on the ports that matter, and snmp if you are watching routers or switches (pysnmp is the python lib for that). for the dashboard on low resources, sqlite or a small timeseries db plus flask or fastapi is plenty to start with.
anomaly detection can start dumb, like compare the latest value to the average and standard deviation of the last hour, flag it if its way off. you can get fancy later once the data is flowing :)
1
u/Lumethys 2d ago
OpenTelemetry and whatever O11Y backend of your choice. I prefer VictoriaStack
1
u/avalexva 1d ago
one more trick for the dynamic ip problem that nobody mentioned: put the devices on tailscale. each device gets a stable 100.x address that stays the same no matter what network or ip it sits on, so the whole discovery headache just goes away. free tier covers plenty of devices and the agent is tiny, which fits your low-resource requirement.
you'd still do the phone-home thing for the actual metrics, tailscale just guarantees you can always reach the box itself when you need to poke it manually. saved me a lot of pain on a similar setup :)
1
u/beevek 15h ago
why do you need to build vs leveraging off the shelf tech? grafana cloud at free tier with orb/pktvisor gets you a long way.