How paduartesre/psm works
Project type and purpose
• This is an observability/monitoring toolkit (PSM – Proact System Monitor) implemented in Bash/Shell scripts.
• It gathers metrics (CPU, memory, database metrics, logs, link status), imports them into a PostgreSQL database, and surfaces them in Grafana (with Apache as a likely reverse‐proxy/web server).
File structure
• Top level:
• install-psm.sh, create-db-psm.sql → installation and database‐creation scripts
• base/ → metric‐collection scripts (cpu_metrics.sh, so_metrics.sh, dbmetrics-get-files.sh, etc.)
• scripts/ → data‐insertion, VPN checks, memory traps, PSM‐specific insert scripts
• parser/ → parsing logic (test.txt suggests parsing or pattern files)
• results-link.sh → likely post‐processing or link generation for Grafana dashboards
• No application code in a compiled language—pure shell utilities plus SQL.
README for additional insights
• Installation sequence: install script, SQL to create DB, configure credentials, schedule cron jobs.
• External dependencies: PostgreSQL, Grafana, Apache, Linux environment.
a. Main components
• Monitored Nodes (Servers)
• Cron scheduler on each node
• Collection scripts (base/)
• Parsing & insertion scripts (parser/, scripts/)
• Central PostgreSQL database
• Grafana (dashboard front end) behind Apache
b. Relationships & data flow
1. Cron → invokes base/*.sh on each monitored node
2. base/*.sh → fetch raw data (e.g., logs, metrics) from local or remote sources
3. parser/*.sh or scripts/*.sh → transform/parse data into insert statements
4. scripts/insert*.sh → write metrics into PostgreSQL via DB connection
c. Architectural patterns & principles
• Modular script grouping: collection vs. insertion
• Cron‐driven, push‐based metric ingestion
• Separation of concerns: data collection, transformation, storage, visualization
d. Key technologies
• Bash/Shell scripting, cron, SSH/scp or native file read for data gathering
• PostgreSQL (metrics storage)
• SQL scripts for schema/DB setup
• Grafana dashboards (possibly served via Apache HTTPD)
Detail‐level recommendations
• Cron schedules or indicate “cron.d/*.cron” on the scheduler symbol
• SQL schema initialization step (install-psm.sh → create-db-psm.sql)
• External dependencies (Grafana, Apache) and their version/config relationships
• If using SSH or file-transfer to remote servers, show that edge with a “Secure channel” notation