Building a Simple Server Monitoring Script in My Homelab

*Why monitoring matters *

Monitoring matters because it provides a shared feedback loop, necessary visibility in the system metrics, performance, security, it also enables rapid issue detection, and continous improvement

See my code in my github here:- https://github.com/KithupaG/Homelab/blob/main/monitoring/server-stats.sh

How I built it

I used functions to house the processes, adhering to the laws of writing code, inside those functions I housed the shell commands such as top, free, df, ps etc to fetch the data and used awk to tabularize the data.

  1. Demo output.

  1. Future plan
  2. Add logging to a fileserver_stats.log.
  3. Output as JSON so it integrates with Prometheus/ELK.
  4. Connect to Grafana and make dashboards.

Similar Posts