Skip to content

Instantly share code, notes, and snippets.

@dirumahrafif
Last active May 29, 2025 08:09
Show Gist options
  • Select an option

  • Save dirumahrafif/fae4f3fad9b8ebf4ee3e2f4ec66e01de to your computer and use it in GitHub Desktop.

Select an option

Save dirumahrafif/fae4f3fad9b8ebf4ee3e2f4ec66e01de to your computer and use it in GitHub Desktop.
Monitoring Stack
services:
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
restart: always
grafana:
image: grafana/grafana-oss
container_name: grafana
ports:
- "3000:3000"
volumes:
- grafana-storage:/var/lib/grafana
restart: always
node-exporter:
image: prom/node-exporter
container_name: node-exporter
ports:
- "9100:9100"
restart: always
volumes:
grafana-storage:
global:
scrape_interval: 15s
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: "node-exporter"
static_configs:
- targets: ["node-exporter:9100"]
#!/bin/bash
# Cek apakah dijalankan sebagai root
if [ "$EUID" -ne 0 ]; then
echo "Silakan jalankan sebagai root (sudo)"
exit
fi
echo "πŸ“¦ Menginstall semua tools yang dibutuhkan..."
apt update
apt install -y stress stress-ng apache2-utils iperf3 curl wget
echo ""
echo "🧠 Mulai stress test CPU dan RAM..."
stress-ng --cpu 4 --vm 2 --vm-bytes 512M --timeout 60s
echo ""
echo "πŸ’½ Mulai disk I/O test..."
dd if=/dev/zero of=tempfile bs=1M count=1024 oflag=dsync
rm tempfile
echo ""
echo "🌐 Mulai jaringan (iperf3) test..."
echo "➑️ Jalankan perintah berikut di komputer lokal kamu:"
echo " iperf3 -c $(curl -s ifconfig.me)"
echo "πŸ”„ Di VPS ini, iperf3 server akan aktif selama 60 detik..."
timeout 60 iperf3 -s &
sleep 5
echo ""
echo "βœ… Semua stress test selesai."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment