Files
freshStartScript/README.md

138 lines
3.2 KiB
Markdown
Raw Normal View History

2024-12-08 15:05:13 -05:00
# 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
```
2025-12-01 10:52:27 -05:00
or if you want to run instantly without downloading (recommended)
```bash
curl -s http://10.10.10.63:3000/LotusGuild/freshStartScript/raw/branch/main/freshStart.sh | bash
```
2024-12-08 15:05:13 -05:00
## 📦 Components Installed
2026-01-01 16:00:44 -05:00
### System Packages
2024-12-08 15:05:13 -05:00
* python3-pip
* smartmontools
* iperf3
* python3-psutil
* python3-requests
2026-01-01 16:00:44 -05:00
* lm-sensors
* neofetch
* rsync
2024-12-08 15:05:13 -05:00
2026-01-01 16:00:44 -05:00
### Prometheus Node Exporter
2024-12-08 15:05:13 -05:00
✅ Installed as a systemd service
✅ Runs on default port 9100
✅ Configured to start on boot
2026-01-01 16:00:44 -05:00
### Hardware Monitoring Daemon (hwmon)
2024-12-08 15:05:13 -05:00
✅ Installed as a systemd service and timer
2026-01-01 16:00:44 -05:00
✅ Performs regular system health checks every 15 minutes
2024-12-08 15:05:13 -05:00
✅ Creates tickets for detected issues
2026-01-01 16:00:44 -05:00
**NEW:** API key configuration via `/etc/hwmonDaemon/.env`
## ⚙️ Configuration
### hwmonDaemon API Key Setup
The script will prompt you for an API key during installation. You can:
**Option 1: Enter during installation**
```bash
Enter API key (or press Enter to skip): d8f356a06bd5612eca9c5ff948b592a56020cc61937764461458372c9ef30931
```
**Option 2: Configure later**
Edit the configuration file:
```bash
nano /etc/hwmonDaemon/.env
```
Add your API key:
```env
TICKET_API_KEY=your_actual_api_key_here
TICKET_API_URL=http://10.10.10.45/create_ticket_api.php
```
The `.env` file is created with restricted permissions (`chmod 600`) for security.
## 🔍 Verification
2024-12-08 15:05:13 -05:00
Verify service status after installation:
```bash
systemctl status node_exporter
systemctl status hwmon.timer
```
2026-01-01 16:00:44 -05:00
Test hwmonDaemon with dry-run:
```bash
/usr/bin/env python3 -c "import urllib.request; exec(urllib.request.urlopen('http://10.10.10.63:3000/LotusGuild/hwmonDaemon/raw/branch/main/hwmonDaemon.py').read().decode('utf-8'))" --dry-run
```
Check if API key is loaded:
```bash
cat /etc/hwmonDaemon/.env
journalctl -u hwmon.service | grep "TICKET_API_KEY"
```
## 🌐 Network Requirements
| Service | Purpose |
|---------|---------|
| GitHub | Node Exporter download |
| 10.10.10.63:3000 | hwmon daemon files (Gitea) |
| 10.10.10.45 | Ticket API access |
## 📁 File Locations
| File/Directory | Purpose |
|---------------|---------|
| `/etc/hwmonDaemon/.env` | API key configuration |
| `/var/log/hwmonDaemon/` | hwmon log files |
| `/etc/systemd/system/hwmon.service` | hwmon systemd service |
| `/etc/systemd/system/hwmon.timer` | hwmon systemd timer |
| `/usr/local/bin/node_exporter` | Node Exporter binary |
## 🔧 Troubleshooting
### hwmonDaemon not creating tickets
Check if API key is configured:
```bash
cat /etc/hwmonDaemon/.env
```
Check logs for authentication errors:
```bash
journalctl -u hwmon.service -n 50
```
### Update API key after installation
Edit the configuration file:
```bash
nano /etc/hwmonDaemon/.env
```
No service restart needed - changes take effect on next run.