Skip to content

Zhenyaof/InfraPulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

InfraPulse

Lightweight Infrastructure Monitoring & Alerting System built with Bash.

InfraPulse is a lightweight monitoring agent designed to observe and report the health of multiple infrastructure nodes (Linux / VMware ESXi). It collects system performance metrics such as CPU load, memory usage, disk usage, and host availability, then stores the results in both human-readable logs and structured JSON format for automation and future cloud integration.

Overview

InfraPulse continuously monitors remote hosts over the network and provides:

  • Host availability checking (UP/DOWN via ping)
  • CPU load monitoring
  • Memory usage collection
  • Disk usage monitoring
  • Health score calculation

It generates two types of outputs:

  • Human-readable logs for manual inspection
  • JSON output for machine processing, automation, and APIs

It also includes a basic alerting system and supports automation via cron jobs.

Features

  • Multi-host monitoring (Linux / ESXi)
  • Ping-based host availability check
  • CPU / RAM / Disk usage collection via SSH
  • Structured logging system (monitor.log)
  • JSON output for automation (output.json)
  • Alerting system (alerts.log)
  • Health score calculation
  • Cron-based scheduling support

Architecture

The monitoring workflow is as follows:

  1. Ping target hosts
  2. Connect via SSH
  3. Collect system metrics (CPU, RAM, Disk)
  4. Write human-readable logs
  5. Generate JSON structured output
  6. Trigger alerts if thresholds are violated

Project Structure

InfraPulse/
├── scripts/
│   └── monitor.sh
├── logs/
│   ├── monitor.log
│   ├── alerts.log
│   └── output.json
├── .gitignore
└── README.md

Installation

git clone <repo-url>
cd InfraPulse
chmod +x scripts/monitor.sh

Usage

Run manually:

./scripts/monitor.sh

View logs:

cat logs/monitor.log
tail -f logs/monitor.log

View JSON output:

cat logs/output.json

Automation (Cron Job)

InfraPulse can be scheduled using cron for continuous monitoring.

Edit crontab:

crontab -e

Add the following line:

*/5 * * * * /opt/infra-pulse/scripts/monitor.sh >> /dev/null 2>&1

This runs the monitoring system every 5 minutes automatically.

Alerting System

InfraPulse supports basic alerting for critical conditions.

Example email alert using mailx:

echo "Host is DOWN" | mail -s "InfraPulse Alert" admin@example.com

Alerts can be triggered for:

  • Host unreachable (DOWN)
  • High disk usage
  • Missing or failed metric collection

Output Examples

Human-readable Log

[INFO] 192.168.4.10 is UP
[CPU LOAD] 0.01, 0.02, 0.00
[MEMORY] 4189040640 bytes
[DISK USAGE] 16%

JSON Output

{
  "host": "192.168.4.10",
  "status": "UP",
  "cpu": "0.01, 0.02, 0.00",
  "memory": "4189040640",
  "disk": "16%"
}

Future Improvements

  • Telegram alert integration
  • Web dashboard (HTML / React)
  • Prometheus exporter
  • Grafana visualization
  • Cloud-native deployment (AWS / Azure / GCP)
  • REST API for monitoring data
  • Kubernetes monitoring support

Tech Stack

  • Bash
  • SSH
  • VMware ESXi CLI
  • Linux System Utilities
  • Cron
  • Python

Author

InfraPulse – Infrastructure Monitoring & Observability Lab Project

About

InfraPulse is a lightweight infrastructure monitoring and alerting system for multi-host environments with structured logging and JSON output.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages