This project facilitates the monitoring of the health state of disks using the alt-f project. The standard way to monitor the disks would be using the netsnmp
package, but I couldn't manage to make it work on my old D-Link DNS-320. So I decided to create this simple page that returns all the disk attributes in JSON format. This allows you to add monitors using tools like Uptime Kuma, for example.
- Scrapes disk health data from the alt-f status page
- Exposes disk attributes in JSON format via a simple REST API
- Easy integration with monitoring tools like Uptime Kuma
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/adilson0888/alt-f-disk-monitor cd alt-f-disk-monitor
-
Create a .env file with the URL of your alt-f status page:
STATUS_PAGE_URL=http://nas-ip
- Build and start the services using Docker Compose:
docker-compose up -d
- The application will be available at http://localhost:3800.
GET /devices/
Returns the JSON representation of the specified device.
Example:
curl http://localhost:3800/devices/sdb3
Response:
{
"available": "240.3GB",
"capacity": "687.1GB",
"device": "sdb3",
"dirty": false,
"fs": "ext4",
"fsck": "22 mounts or 150 days",
"label": "",
"mode": "RW"
}
You can integrate this API with Uptime Kuma to monitor the health state of your disks. Add a new HTTP monitor in Uptime Kuma using the Http(s) - Json Query So you can set expected values to any of the disk attributes.
This project is licensed under the MIT License. See the LICENSE file for details.