Resource Monitoring

Monitor CPU, RAM, disk, and network usage on your TinyBox VPS

Built-in Monitoring Commands

System Overview

# Quick system overview
htop

# CPU and load average
uptime

# System information
uname -a
lscpu

Memory Usage

# Memory usage summary
free -h

# Real-time memory usage
watch -n 2 free -h

# Top memory processes
ps aux --sort=-%mem | head -10

Disk Usage

# Disk space usage
df -h

# Directory sizes
du -sh /* 2>/dev/null | sort -hr

# Real-time I/O monitoring
iostat -x 1

Network Usage

# Network connections
ss -tuln

# Network traffic (install iftop)
iftop

# Bandwidth usage
vnstat -i eth0

TinyBox System Monitor Script

#!/bin/bash
# TinyBox VPS System Monitor
# Save as: /usr/local/bin/tinybox-monitor.sh

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

echo -e "${BLUE}🖥️  TinyBox VPS System Monitor${NC}"
echo "========================================"
date
echo

# System info
echo -e "${BLUE}📊 System Information:${NC}"
echo "Hostname: $(hostname)"
echo "Uptime: $(uptime -p)"
echo "Kernel: $(uname -r)"
echo

# CPU and Load
echo -e "${BLUE}🔥 CPU & Load Average:${NC}"
LOAD1=$(uptime | awk '{print $10}' | sed 's/,//')
LOAD5=$(uptime | awk '{print $11}' | sed 's/,//')
LOAD15=$(uptime | awk '{print $12}')

echo "Load Average: $LOAD1 (1min) $LOAD5 (5min) $LOAD15 (15min)"

# CPU cores
CORES=$(nproc)
echo "CPU Cores: $CORES"

# Load analysis
if (( $(echo "$LOAD1 > $CORES" | bc -l) 2>/dev/null )); then
    echo -e "${RED}⚠️  High CPU load detected!${NC}"
elif (( $(echo "$LOAD1 > $(echo "$CORES * 0.7" | bc)" | bc -l) 2>/dev/null )); then
    echo -e "${YELLOW}⚡ Moderate CPU load${NC}"
else
    echo -e "${GREEN}✅ CPU load normal${NC}"
fi
echo

# Memory Usage
echo -e "${BLUE}💾 Memory Usage:${NC}"
free -h
echo

MEM_PERCENT=$(free | grep Mem | awk '{printf("%.0f", $3/$2 * 100.0)}')
echo "Memory Usage: ${MEM_PERCENT}%"

if [ $MEM_PERCENT -gt 90 ]; then
    echo -e "${RED}⚠️  Critical memory usage!${NC}"
elif [ $MEM_PERCENT -gt 80 ]; then
    echo -e "${YELLOW}⚡ High memory usage${NC}"
else
    echo -e "${GREEN}✅ Memory usage normal${NC}"
fi
echo

# Disk Usage
echo -e "${BLUE}💿 Disk Usage:${NC}"
df -h /
echo

DISK_PERCENT=$(df / | tail -1 | awk '{print $5}' | sed 's/%//')
echo "Disk Usage: ${DISK_PERCENT}%"

if [ $DISK_PERCENT -gt 90 ]; then
    echo -e "${RED}⚠️  Critical disk usage!${NC}"
elif [ $DISK_PERCENT -gt 80 ]; then
    echo -e "${YELLOW}⚡ High disk usage${NC}"
else
    echo -e "${GREEN}✅ Disk usage normal${NC}"
fi
echo

# Top processes by CPU
echo -e "${BLUE}🔥 Top 5 CPU Consumers:${NC}"
ps aux --sort=-%cpu | head -6
echo

# Top processes by Memory
echo -e "${BLUE}🧠 Top 5 Memory Consumers:${NC}"
ps aux --sort=-%mem | head -6
echo

# Network connections
echo -e "${BLUE}🌐 Active Network Connections:${NC}"
CONNECTIONS=$(ss -tuln | wc -l)
echo "Total connections: $CONNECTIONS"

# Service status
echo
echo -e "${BLUE}🔧 Key Services Status:${NC}"
for service in ssh nginx apache2 mysql postgresql; do
    if systemctl is-active --quiet $service 2>/dev/null; then
        echo -e "${GREEN}✅ $service is running${NC}"
    elif systemctl list-unit-files | grep -q "^$service.service"; then
        echo -e "${RED}❌ $service is stopped${NC}"
    fi
done

echo
echo "===========================================" 
echo "Monitor completed at $(date)"

# Make executable: chmod +x /usr/local/bin/tinybox-monitor.sh

💡 Usage Instructions

# Make executable
chmod +x /usr/local/bin/tinybox-monitor.sh

# Run the monitor
/usr/local/bin/tinybox-monitor.sh

# Add to cron for regular monitoring (every 30 minutes)
echo "*/30 * * * * /usr/local/bin/tinybox-monitor.sh >> /var/log/system-monitor.log" | crontab -

TinyBox Control Panel Monitoring

Built-in Monitoring Dashboard

Your TinyBox control panel provides real-time monitoring with graphs and alerts for all system resources.

✓ Available Metrics

  • • CPU usage (real-time & historical)
  • • RAM consumption with swap details
  • • Disk I/O and space utilization
  • • Network bandwidth usage
  • • Load average trends
  • • Process monitoring
  • • Service status monitoring

📊 Graph Timeframes

  • 1 Hour: Real-time monitoring
  • 6 Hours: Recent trends
  • 24 Hours: Daily patterns
  • 7 Days: Weekly analysis
  • 30 Days: Monthly overview

Recommended Alert Thresholds

TINY 1.0 VPS Thresholds

CPU Load (1min): > 0.8
RAM Usage: > 80% (800MB)
Disk Usage: > 85% (17GB)
Swap Usage: > 50%

TINY 2.1 VPS Thresholds

CPU Load (1min): > 1.5
RAM Usage: > 85% (1.7GB)
Disk Usage: > 80% (32GB)
Swap Usage: > 25%

✓ Monitoring Best Practices

  • • Check system status daily
  • • Set up automated monitoring scripts
  • • Monitor during peak usage times
  • • Keep historical data for trend analysis
  • • Configure email alerts for critical issues
  • • Use control panel graphs for quick overview
  • • Document normal usage patterns
  • • Plan capacity upgrades based on trends