Skip to content
Back to Projects
$ ./daily-report --mode=casestudy

Daily System Report

LiveInfrastructure

# From dashboard overload to a single morning email

Starting Point

2024-03-15 07:00:01 --- CHALLENGE ---
[WARN]

Every morning, checking various dashboards, apps, and tools — SSL status, backups, server uptime, logs, cloud costs. Takes time, and things get missed.

[INFO]

There was no unified system that queries all relevant sources, prioritizes intelligently, and summarizes everything in a single, clean report.

Implementation

[STEP 1]

Definition of the most important data sources: SSL certificates, backups, system logs, uptime, cloud costs, calendar, tasks.

|v
[STEP 2]

Modular collector pipeline: Each collector is a standalone Bash script that delivers JSON metrics. New sources are integrated in minutes.

|v
[STEP 3]

Python-based report generator with Jinja2 templates: takes the JSON data, prioritizes by severity, and renders a responsive HTML template.

|v
[STEP 4]

Automatic delivery via SMTP at 07:00 through a systemd timer. Discord webhook planned as a second channel.

Functions

Module
Collector Pipeline Architecture

Modular Bash collectors deliver JSON. SSL, backup, logs, uptime, costs — each independent, easily extensible.

Smart Prioritization

Critical issues on top, routine at the bottom. Overdue detection, color-coded severity levels, clear visual hierarchy.

Trend Analysis

Historical data in MariaDB. CPU/RAM/disk trends over weeks, anomaly detection through baseline comparison.

Multi-Channel Delivery

Email as primary channel, Discord webhook as supplement. Configurable per recipient and severity.

Technical Details

The architecture follows a clear principle: Collect, Process, Present. Each layer is independently replaceable.

[dependencies]
bash = "Collector scripts"
python = "Report generator"
jinja2 = "HTML templates"
mariadb = "Database"
smtp = "Email delivery"
systemd = "Scheduling"
# Bash + JSON as Collector Format

Bash is available everywhere, JSON is machine-readable and easy to parse. Each collector is a standalone script that doesn't block the rest on failure.

# Python + Jinja2 for Reports

Python for data processing and logic, Jinja2 for clean HTML templates. Separation of logic and presentation enables quick template changes without code modifications.

# systemd over Cron

systemd timers offer logging, dependencies, and error handling out of the box. No silent failures like with cron.

Status

Over 180 automated reports in 3 months of operation. 12 anomalies detected early, zero unnoticed outages.

The system has established itself as a reliable daily companion — a single glance at the inbox is enough to know the state of all systems.

180+
Reports delivered
12
Anomalies detected
0
Unnoticed outages
// lesson learned:

grep -c returns exit code 1 when count is 0 — || echo 0 produces "0\n0". Fix: var=$(cmd | grep -c) || true

// lesson learned:

Jinja2's dict.items conflicts with Python dict method — use backups['items'] instead of backups.items in templates.

Roadmap

## v1.0 — Now

ACTIVE
[x]SSL, backup, log, uptime and cost monitoring in production
[x]Anomaly detection in use
[x]Stable daily reports

## v1.1 — Next

[ ]Multi-server: monitor multiple servers from one instance
[ ]Dashboard UI for configuration
[ ]Multi-channel (Push/Discord)
[ ]Personalizable content

## v2.0 — Later

[ ]Analytics and trends
[ ]Additional data sources and integrations