Metadata-Version: 2.4
Name: smalk_disk_check
Version: 0.2.0
Summary: smalk implementation for disk checking and monitoring.
Author-email: The220th <The220th@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/The220th/smalk_disk_check
Project-URL: Issues, https://github.com/The220th/smalk_disk_check/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: alerk_pack
Requires-Dist: ksupk
Requires-Dist: pySMART
Requires-Dist: requests
Requires-Dist: pyyaml
Requires-Dist: argparse
Dynamic: license-file

# smalk_disk_check

[smalk](https://github.com/The220th/alerk?tab=readme-ov-file#writing-your-own-smalk) implementation for disk checking and monitoring.

> [!WARNING]
> This project has not been audited for security.

# Installation

Install packages:

```bash
sudo apt update && sudo apt install util-linux mdadm smartmontools  # Debian-like
# or
sudo pacman -Sy util-linux mdadm smartmontools  # Arch
```

Install form pip:

```bash
python3 -m pip install --upgrade pip
pip3 install smalk_disk_check
```

# Configuration and running

Copy `settings_template.yaml` as `settings.yaml`, change it as you need and run ([read more about keys](https://github.com/The220th/alerk)):

```bash
smalk_disk_check /path/to/settings.yaml
```

# Run it with startup

Create script `smalk_disk_check.sh` (as root):

```bash
#!/bin/bash
SCRIPT_DIR_PATH=$(dirname "$0")
VENV_PATH="$SCRIPT_DIR_PATH/venv"

if [ ! -d "$VENV_PATH" ]; then
    python3 -m venv "$VENV_PATH"

    . "$VENV_PATH/bin/activate"

    pip3 install --upgrade pip

    pip3 install smalk_disk_check
else
    . "$VENV_PATH/bin/activate"
fi

smalk_disk_check /path/to/settings.yaml
```

Then do it executable and set up crontab.

```bash
sudo chmod u+x /path/to/smalk_disk_check.sh

sudo crontab -e  # sudo pacman -S cronie or sudo apt install cronie 
                    # -> sudo systemctl start cronie && sudo systemctl enable cronie

# add to the end:
@reboot sleep 30 && /path/to/smalk_disk_check.sh
```

And reboot to test. **Do not forget** change `app.interactive` to `False` in `/path/to/settings.yaml`.

Or do it as systemd service.
