#!/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."