First initial commit
This commit is contained in:
57
README.md
Normal file
57
README.md
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
# Fresh Start Installation Script 🚀
|
||||||
|
|
||||||
|
> A powerful bash script for automating Proxmox installations with monitoring tools and system health checks.
|
||||||
|
|
||||||
|
## ✨ Features
|
||||||
|
|
||||||
|
* 📦 Installs essential system packages
|
||||||
|
* 📊 Sets up Prometheus Node Exporter (v1.8.2)
|
||||||
|
* 🔍 Configures system health monitoring daemon (hwmon)
|
||||||
|
* ✅ Performs initial dry-run test of monitoring systems
|
||||||
|
|
||||||
|
## 📋 Prerequisites
|
||||||
|
|
||||||
|
* Debian-based system (Proxmox)
|
||||||
|
* Root/sudo access
|
||||||
|
* Internet connectivity
|
||||||
|
|
||||||
|
## 🛠️ Installation
|
||||||
|
|
||||||
|
Execute these commands as root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x freshStart.sh
|
||||||
|
./freshStart.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📦 Components Installed
|
||||||
|
**System Packages:**
|
||||||
|
|
||||||
|
* python3-pip
|
||||||
|
* smartmontools
|
||||||
|
* iperf3
|
||||||
|
* python3-psutil
|
||||||
|
* python3-requests
|
||||||
|
|
||||||
|
**Prometheus Node Exporter:**
|
||||||
|
✅ Installed as a systemd service
|
||||||
|
✅ Runs on default port 9100
|
||||||
|
✅ Configured to start on boot
|
||||||
|
|
||||||
|
**Hardware Monitoring Daemon (hwmon):**
|
||||||
|
✅ Installed as a systemd service and timer
|
||||||
|
✅ Performs regular system health checks
|
||||||
|
✅ Creates tickets for detected issues
|
||||||
|
|
||||||
|
🔍 **Verification**
|
||||||
|
Verify service status after installation:
|
||||||
|
```bash
|
||||||
|
systemctl status node_exporter
|
||||||
|
systemctl status hwmon.timer
|
||||||
|
```
|
||||||
|
|
||||||
|
🌐 **Network Requirements**
|
||||||
|
Service Purpose
|
||||||
|
GitHub Node Exporter download
|
||||||
|
10.10.10.110:3000 hwmon daemon files
|
||||||
|
10.10.10.45 Ticket API access
|
||||||
59
freshStart.sh
Normal file
59
freshStart.sh
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on any error
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Starting Proxmox fresh installation script..."
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
echo "Installing required packages..."
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y python3-pip smartmontools iperf3 python3-psutil python3-requests
|
||||||
|
|
||||||
|
# Install Node Exporter
|
||||||
|
echo "Installing Prometheus Node Exporter..."
|
||||||
|
NODE_EXPORTER_VERSION="1.8.2"
|
||||||
|
wget "https://github.com/prometheus/node_exporter/releases/download/v${NODE_EXPORTER_VERSION}/node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64.tar.gz"
|
||||||
|
tar xvfz node_exporter-*.linux-amd64.tar.gz
|
||||||
|
|
||||||
|
# Create node_exporter user and group
|
||||||
|
useradd -rs /bin/false node_exporter
|
||||||
|
|
||||||
|
# Move binary to proper location
|
||||||
|
mv node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64/node_exporter /usr/local/bin/
|
||||||
|
rm -rf node_exporter-*.linux-amd64.tar.gz node_exporter-*.linux-amd64
|
||||||
|
|
||||||
|
# Create node_exporter service file
|
||||||
|
cat > /etc/systemd/system/node_exporter.service << 'EOL'
|
||||||
|
[Unit]
|
||||||
|
Description=Node Exporter
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=node_exporter
|
||||||
|
Group=node_exporter
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/local/bin/node_exporter
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOL
|
||||||
|
|
||||||
|
# Enable and start node_exporter
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable node_exporter
|
||||||
|
systemctl start node_exporter
|
||||||
|
|
||||||
|
# Install hwmon daemon
|
||||||
|
echo "Installing hwmon daemon..."
|
||||||
|
curl -o /etc/systemd/system/hwmon.service http://10.10.10.110:3000/JWS/hwmonDaemon/raw/branch/main/hwmon.service
|
||||||
|
curl -o /etc/systemd/system/hwmon.timer http://10.10.10.110:3000/JWS/hwmonDaemon/raw/branch/main/hwmon.timer
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable hwmon.timer
|
||||||
|
systemctl start hwmon.timer
|
||||||
|
|
||||||
|
# Test hwmon
|
||||||
|
echo "Testing hwmon dry-run..."
|
||||||
|
/usr/bin/env python3 -c "import urllib.request; exec(urllib.request.urlopen('http://10.10.10.110:3000/JWS/hwmonDaemon/raw/branch/main/hwmonDaemon.py').read().decode('utf-8'))" --dry-run
|
||||||
|
|
||||||
|
echo "Installation complete! Please verify all services are running correctly."
|
||||||
Reference in New Issue
Block a user