feat: add community container nextcloud-exporter

- allows monitoring your nextcloud with prometheus
- You can create a Dashboard in Grafana to visualize the collected data

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
Benjamin Brahmer 2025-09-05 12:11:54 +02:00
parent cfaf69fb58
commit 6eaceb1c83
2 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{
"aio_services_v1": [
{
"container_name": "nextcloud-aio-nextcloud-exporter",
"display_name": "Prometheus Nextcloud Exporter",
"documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/nextcloud-exporter",
"image": "ghcr.io/xperimental/nextcloud-exporter",
"image_tag": "0.8.0",
"internal_port": "9205",
"restart": "unless-stopped",
"depends_on": [
"nextcloud-aio-nextcloud"
],
"ports": [
{
"ip_binding": "%APACHE_IP_BINDING%",
"port_number": "9205",
"protocol": "tcp"
}
],
"environment": [
"TZ=%TIMEZONE%",
"NEXTCLOUD_SERVER=https://%NC_DOMAIN%",
"NEXTCLOUD_AUTH_TOKEN=%NEXTCLOUD_EXPORTER_TOKEN%",
"NEXTCLOUD_LISTEN_ADDRESS=0.0.0.0:9205",
"NEXTCLOUD_TIMEOUT=5s",
"NEXTCLOUD_TLS_SKIP_VERIFY=true"
],
"secrets": [
"NEXTCLOUD_EXPORTER_TOKEN"
],
"nextcloud_exec_commands": [
"php /var/www/html/occ config:app:set serverinfo token --value \"%NEXTCLOUD_EXPORTER_TOKEN%\""
]
}
]
}

View file

@ -0,0 +1,43 @@
## Prometheus Nextcloud Exporter
A Prometheus exporter that collects metrics from your Nextcloud instance for monitoring and alerting.
### What it does
- Monitors user activity, file counts, and storage usage
- Tracks system health, database size, and app statistics
- Exposes metrics on port `9205` for Prometheus to scrape
- Uses Nextcloud's serverinfo API with secure token authentication
### Use cases
- Monitor Nextcloud performance and capacity
- Set up alerts for system issues or resource limits
- Create dashboards showing usage trends and system health
- Track active users and storage growth over time
### Prometheus Configuration
Add this to your `prometheus.yml` to scrape the exporter:
```yaml
scrape_configs:
- job_name: 'nextcloud'
scrape_interval: 90s
static_configs:
- targets: ['your-nextcloud-domain.com:9205']
metrics_path: /metrics
scheme: http
```
Replace `your-nextcloud-domain.com` with your actual Nextcloud domain.
### Notes
Automatically configures the required serverinfo token for authentication between Nextcloud and the exporter.
Compatible with Grafana for visualization (dashboard ID `20716` available).
https://grafana.com/grafana/dashboards/20716-nextcloud/
### Repository
https://github.com/xperimental/nextcloud-exporter
### Maintainer
https://github.com/grotax