I use some batch scripts in my proxmox installation. They are in cron.hourly and daily checking for virus and ram/CPU load of my LXC containers. An email is send on condition.

What are your tipps or solution without unnecessary load on disc io or CPU time. Lets keep it simple.

Edit: a lot of great input about possible solutions. In addition TIL “that keep it simple” means a lot of different things to people.😉

13 points

Prometheus, Loki and Grafana.

And so so many Prometheus metric exporters.

Observability is such an endless rabbit hole, it’s so easy for me to spend huge amounts of time accomplishing not that much lol. But very enjoyable and cool to see it all come together.

My pro tips: using Kubernetes actually makes this stuff a heck of a lot easier to set up thanks to the common patterns that k8s has - lots of turnkey helm charts out there that make it all so easy and are powerful. Another tip would be to use Prometheus service discovery if you can. Also, Loki/Promtail is actually quite easy to set up - but using LogQL queries can be very tricky. Just be warned, observability is a full time hobby in itself lol

permalink
report
reply
2 points
*

I’m in a similar boat except I just do everything on standard Docker containers but so do use Telegraf, Influx, and Grafana for everything. I’ve gone mostly to Discord notifications on any alerts. If I run into any problem scenarios, I figure out how to monitor it and add it via Telegraf and add an alert. I’m still just using Grafana alerts but it works fine for my home lab.

Even better if I can automate fixes to those problems. One of the best things I did was monitoring all of my network devices and all major hops. If I have internet or network issues, I know exactly where the problem is without having to troubleshoot. Lots of dpinger and shell scripts to input data to Telegraf.

permalink
report
parent
reply
9 points

I’ll keep it very simple: I don’t.

If I’m trying to do something and I notice an issue, then I’ll investigate it. But if it’s not affecting anything, is it really a problem?

permalink
report
reply
4 points

I was kind of the same, but I still collected metrics, because I just love graphs.

Over time I ended up setting alerts for failures I wish I was aware of earlier. Some examples:

  • HDD monitoring - usually drive is showing signs of failure couple days before it fails, so I have time to shop around for replacement. If I had no alert set, I’d probably only notice when both sides of a mirror failed which would mean couple days of downtime, lot of work with backup restoration and very limited time to find drive for reasonable price
  • networking issues - especially VPN, it’s much better to know that it is broken before you leave house
  • some core services like DNS. With two Adguard instances it’s much better to be alerted when one is down, than to realize that you suddenly have no DNS when both fail and you can’t even google stuff without messing with your connection settings.
  • SSD writes - same as HDDs, but in this case the alert is around 90% declared TBW lifetime claimed by manufacturer and I tend to replace them proactively as they are usually used as system disk without mirror, which holds no valuable data, but would again lead to extended unplanned downtime
  • CPU usage being maxed out for long time - I had one service fail in a way where it consumed 100% of all cores. This had no impact on other services because process scheduler did its job, but I ended up burning kilowats of electricity as this continued unnoticed for weeks. This was before energy prices went up, but it was still noticeable power consumption. (Had double CPU server back then, that consumed a lot of juice when maxed out)
permalink
report
parent
reply
2 points

What do you use to collect these metrics?

permalink
report
parent
reply
2 points

I use Telegraf for most of the metrics.

permalink
report
parent
reply
6 points

I’ve used monit for maybe 2 decades now. Works great and simple to use.

https://mmonit.com/monit/

permalink
report
reply
0 points

Nice, will take a look into it

permalink
report
parent
reply
5 points
*

https://github.com/awesome-foss/awesome-sysadmin#monitoring

I use netdata (agent only, not the cloud/SaaS stuff)

permalink
report
reply
4 points

I use zabbix to monitor everything, agent on each device uses around 30 mb of memory and with the Linux templates it can monitor just about everything on the server.

permalink
report
reply
3 points

Does zabbix use a database continuously polling and storing data or is live data used for indication and/or triggers?

permalink
report
parent
reply
2 points

Not the above guy but I believe it’s a database.

permalink
report
parent
reply
2 points

Zabbix stores all it’s data in a PostgreSQL or MySQL database. However… there are 2 ways that Zabbix Agents work. Either in passive mode, or in active mode.

Passive Agent = “poller” process on the Zabbix server sends a request to the agent asking for values for the items it’s monitoring (based on template applied to host). Depending on the number of hosts you’re monitoring and how many poller processes are configured to start with the Zabbix server, you may run into a situation where requests are queued because the poller process is too busy. Increasing the number of poller processes will fix this, but it also adds additional load to your DB as each poller process will connect to your DB to write data, and each poller process will consume a certain amount of memory. Too many and you’ll run out of RAM, or bog down your DB.

Active Agent = “trapper” process on the Zabbix server listens for item values from being sent to it from the agents. Agents will query the Zabbix server to see what templates are applied to it’s host, and will figure out what items it’s supposed to monitor. The agent will actively query the items without the Zabbix server requesting it, and will send the item values to the server as scheduled. This puts a lot less load on the Zabbix server.

Item values are not read from the DB to activate the trigger. When a value is received that matches the trigger’s expression, then the trigger is activated. Live values are used to activate triggers and trigger actions (alerts).

permalink
report
parent
reply
1 point

Database.

permalink
report
parent
reply

Selfhosted

!selfhosted@lemmy.world

Create post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

Community stats

  • 4.8K

    Monthly active users

  • 3.5K

    Posts

  • 79K

    Comments