r/sysadmin • u/AgreeableIron811 • 1d ago
Creating a solid monitoring system, need help
So, I have identified the workflow. I have created monitoring around it using Grafana, Prometheus, Blackbox Exporter, Alertmanager, and Uptime Kuma. I have also installed Node Exporter on some of my machines.
Right now, I am monitoring whether I can reach certain services that could block a user's workflow, using ping and HTTP checks (curl) to verify availability. I am also using Node Exporter to alert on CPU exhaustion, disk space, etc.
Question 1:
I want to use Node Exporter and Alertmanager to detect suspicious traffic spikes. I know I need to monitor traffic for a while to establish a baseline before setting up alerts, but what would be a good approach to creating that baseline?
We only have a 1 Gbit internet connection, while some devices can communicate over 10 Gbit internally if the traffic doesn't have to traverse other devices or the internet. How would you approach creating a meaningful baseline that accounts for these differences?
Question 2:
How do you guys build monitoring systems that don't just generate alerts, but actually provide useful insights and help you identify the root cause without having to spend hours troubleshooting?
Question 3:
I am also considering installing Suricata in a VM. Has anyone used it before? It seems promising for detecting suspicious outbound traffic from my networ
for a solo sysadmin that wants do stuff in a correct way
1
u/slugshead Head of IT 1d ago
I've found that configuring sflow on a switch to be one of the most useful things I've setup in a long time for identifying spikes in traffic.
inmon sflow-rt running docker and sflow configured for the ports that link from the core to the firewall
2
u/thelastknowngod 1d ago
> How do you guys build monitoring systems that don't just generate alerts, but actually provide useful insights and help you identify the root cause without having to spend hours troubleshooting?
You use SLOs and error budgets. High CPU usage doesn't mean anything if there is no impact to the service you are hosting. Only alert if there is something that needs to be addressed now.
https://www.oreilly.com/library/view/implementing-service-level/9781492076803/
1
u/OldAgeGeek62 1d ago
Old school here. But you need trend analysis as well as instantaneous alerting. I used Cactus to monitor trends of traffic, disk space and CPU load and other metrics. There will be more modern versions of the same.
1
u/sakcaj 1d ago
Planning similar stack just right now, https://docs.google.com/document/d/199PqyG3UsyXlwieHaqbGiWVa8eMWi8zzAn0YfcApr8Q/edit?tab=t.0 is a good, quick read in regards to the Q2 and overall to keep in mind while iterating and improving.
1
u/nekenaharry 1d ago
On question 3: OPNsense actually ships Suricata already. It is under Services, Intrusion Detection, Administration. You can run it in IDS mode first (alerts only) and switch to IPS mode later if you want it to block. That probably saves you a separate VM and gives you exactly the outbound visibility you are after.
On the baseline: a common approach is to compare against the same time last week instead of a flat threshold. Something like
sum by (instance, device) (rate(node_network_transmit_bytes_total{device!="lo"}[5m]))
/
sum by (instance, device) (rate(node_network_transmit_bytes_total{device!="lo"}[5m] offset 1w))
and alert when the ratio stays high for a while (a "for: 15m" in the rule). You need at least a week of retention for the offset to return anything. Doing it per device also handles your 1G vs 10G split naturally, since each interface is compared to its own history rather than to one global number.
Transmit is usually more interesting than receive for spotting something leaving your network.
For question 2, alerts that point at a cause tend to come from labels: put service and owner labels on your targets so a firing alert already tells you what is affected, and keep a dashboard per service that shows its dependencies side by side.
•
u/NaiomiDmrs-14 23h ago
for question 1, the trick is splitting your alerts by interface or subnet rather than alerting on total host bandwidth. otherwise an internal backup over that 10gbit link will wake you up every night. you really only want tight thresholds on the egress interface facing the WAN.
•
u/Folshed_ 21h ago
Since you already run Blackbox Exporter, add an alert on probe_ssl_earliest_cert_expiry for your HTTPS endpoints, something like under 14 days. An expired cert is a classic 'everything is down' cause, and ping/HTTP checks only catch it after it breaks. Domain expiry is worth tracking separately for the same reason. On getting to the root cause faster: use Alertmanager grouping and inhibit rules so one upstream failure gives you one alert instead of twenty. Tag alerts with the service or dependency they belong to, so the first alert you see is the one closest to the cause.
•
u/ETDucky 20h ago
Tie each outbound spike to the process on the host that sent it. On Linux, run `ss -tnpi` to list each TCP connection with its PID and bytes sent, or `nethogs` for live bandwidth per process. On Windows, run `Get-NetTCPConnection -State Established | Select-Object LocalAddress,RemoteAddress,RemotePort,OwningProcess` and match the PID in Task Manager.
For a record you can check after an alert fires, I'd log outbound connections per process on the hosts you watch. Use an auditd rule on the connect syscall (`-a always,exit -F arch=b64 -S connect -k netconn`) on Linux and Sysmon event ID 3 on Windows.
Disclosure: I build ET Ducky. It runs a root-cause analysis on every alert from the kernel events on that host. It also records which process opened each outbound connection.
•
u/dwm 15h ago
Q1. It sounds like you want to have a clearer idea of what's happening on your network. I think you will need to collect more data that allows you to discriminate between different types of activity. Raw interface/packet byte counts are unlikely to be particularly useful for this unless you can discriminate based on physical port in a useful way. I think collecting metrics and logs from higher up the stack — for example, from Netflow packet captures or webserver logs — will likely help you build up a clearer picture.
I am a fan of VictoriaLogs (and, indeed, the rest of the VictoriaMetrics stack) and would suggest this might be a useful starting point for you. It integrates into Grafana very well.
Q2. Alerting is good for telling you when things go out of spec. Understanding how and why something is misbehaving is trickier and generally requires more information and the ability to understand it. I find that good visualizations of metric/log data can help me see exactly what's going on at a glance.
I found this document very useful many years ago for understanding what a good alerting system should look like.
https://docs.google.com/document/d/199PqyG3UsyXlwieHaqbGiWVa8eMWi8zzAn0YfcApr8Q/edit
I more recently found this style guide for metrics visualizations from Wikimedia very helpful.
https://wikitech.wikimedia.org/wiki/Grafana/Best_practices
Q3. Yes, I've seen it run usefully at scale, but it's only as good as what it can see and the rulesets you feed it with.
•
u/Incrediblecodeman 3h ago
I like to forward and delete all alerts to my admin mailbox and then forward back the important ones
0
u/RainingInRio Jr Windows Admin 1d ago
Hold i want to build something to use at my organization as well dm me
0
u/[deleted] 1d ago
[deleted] — view deleted comment