Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
323 changes: 100 additions & 223 deletions app.py

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ def create_default_config(self):
self.config['schedule'] = {
'backup_cloud_time': '3:00'
}


self.config['hdsentinel'] = {
'enabled': 'true',
'health_change_alert': 'true'
}

self.save_config()

def save_config(self):
Expand Down
29 changes: 15 additions & 14 deletions docs/drive_health.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Drive Health

The Drive Health page allows you to check the health of your storage drive using SMART data and a machine learning model.
The Drive Health page combines two views of the configured backup drive:

- SMART data plus the local machine-learning failure prediction
- HDSentinel health and performance reporting

## Features
- **Error/Warning Alerts**: Shown if SMART data is missing or the model is not loaded.
- **Missing Attributes**: Lists any SMART attributes not available for the drive, with a warning that accuracy may be affected.
- **Prediction Result**: Shows if a failure is predicted, with probability percentage.
- **Run Health Check**: Button to run a new health check (submits the form).
- **SMART Data Table**: Lists all SMART attributes, descriptions, raw values, and status (available/default).
- **Tooltips**: Hover over info icons for detailed attribute descriptions.
- **Download Telemetry**: Button to download SMART telemetry data.
- **Send Telemetry**: Button to email telemetry data.
- **Run Health Check**: Runs a manual SMART and HDSentinel refresh from the page.
- **Prediction Result**: Shows whether the SMART model predicts failure, with probability percentage.
- **Missing Attributes**: Lists SMART attributes that fell back to defaults.
- **HDSentinel Status**: Shows install state, device, model, serial, health, performance, temperature, size, and last checked time.
- **HDSentinel Settings**: Lets users enable or disable HDSentinel monitoring and toggle health-change alerts.
- **SMART Data Table**: Lists SMART attributes, descriptions, raw values, and status.
- **Download Telemetry**: Downloads the SMART telemetry CSV.

## UI Details
- Inline feedback for errors and missing data.
- Table with attribute, description, value, and status.
- Spinners and tooltips for user feedback.
## Alerting
- HDSentinel alerts only trigger on health changes between scheduled checks.
- Temperature is displayed but does not currently trigger alerts.

---

This page helps monitor drive health and predict failures using SMART data.
This page is the main place to inspect the backup drive's current SMART and HDSentinel health data.
31 changes: 24 additions & 7 deletions docs/manual_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Open a terminal and run:

```bash
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-flask python3-flask-socketio python3-psutil python3-xgboost python3-joblib python3-pandas python3-sklearn python3-cryptography smartmontools samba msmtp rsync curl
sudo apt-get install -y python3 python3-pip python3-flask python3-flask-socketio python3-psutil python3-xgboost python3-joblib python3-pandas python3-sklearn python3-cryptography smartmontools samba msmtp rsync curl unzip
```

## 2. Install rclone (Official Script)
Expand All @@ -25,7 +25,24 @@ sudo sh -c "bash $TMPFILE || true"
rm -f "$TMPFILE"
```

## 3. Download and Copy Application Files
## 3. Install HDSentinel

Install the vendor binary to `/usr/local/bin/hdsentinel`.

- `amd64`: `https://www.hdsentinel.com/hdslin/hdsentinel-020c-x64.zip`
- `arm64`: `https://www.hdsentinel.com/hdslin/hdsentinel-armv8.zip`

Example for `amd64`:

```bash
TMPDIR=$(mktemp -d)
curl -L --fail -o "$TMPDIR/hdsentinel.zip" "https://www.hdsentinel.com/hdslin/hdsentinel-020c-x64.zip"
unzip -o "$TMPDIR/hdsentinel.zip" -d "$TMPDIR"
sudo install -m 755 "$TMPDIR/HDSentinel" /usr/local/bin/hdsentinel
rm -rf "$TMPDIR"
```

## 4. Download and Copy Application Files

Clone the repository and copy files to `/opt/SimpleSaferServer`:

Expand All @@ -38,7 +55,7 @@ sudo rsync -a static /opt/SimpleSaferServer/
sudo rsync -a templates /opt/SimpleSaferServer/
```

## 4. Install Scripts and Model Files
## 5. Install Scripts and Model Files

```bash
sudo mkdir -p /usr/local/bin
Expand All @@ -50,7 +67,7 @@ sudo mkdir -p /opt/SimpleSaferServer/harddrive_model
sudo cp harddrive_model/* /opt/SimpleSaferServer/harddrive_model/
```

## 5. Set Up the Systemd Service
## 6. Set Up the Systemd Service

## Email Setup
- **Email Address**: Enter the address for alerts.
Expand All @@ -67,7 +84,7 @@ sudo systemctl enable simple_safer_server_web.service
sudo systemctl restart simple_safer_server_web.service
```

## 6. (Optional) Open Firewall Port 5000
## 7. (Optional) Open Firewall Port 5000

If you use a firewall, open port 5000:

Expand All @@ -85,7 +102,7 @@ If you use a firewall, open port 5000:
sudo iptables -C INPUT -p tcp --dport 5000 -j ACCEPT 2>/dev/null || sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT
```

## 7. Access the Web UI
## 8. Access the Web UI

After installation, open a browser on any device in your network and go to:

Expand All @@ -109,4 +126,4 @@ Follow the setup wizard to complete configuration.

---

For more help, see the [GitHub repository](https://github.com/chrismin13/SimpleSaferServer) or [landing page](https://sss.chrismin13.com).
For more help, see the [GitHub repository](https://github.com/chrismin13/SimpleSaferServer) or [landing page](https://sss.chrismin13.com).
Loading
Loading