This commit is contained in:
2025-11-17 18:51:08 +01:00
parent 14d6f9aa73
commit 7fb0d2212a
318 changed files with 35761 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
{
"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",
"ports": [
{
"ip_binding": "127.0.0.1",
"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"
],
"ui_secret": "NEXTCLOUD_EXPORTER_CADDY_PASSWORD",
"secrets": [
"NEXTCLOUD_EXPORTER_TOKEN",
"NEXTCLOUD_EXPORTER_CADDY_PASSWORD"
],
"nextcloud_exec_commands": [
"php /var/www/html/occ config:app:set serverinfo token --value %NEXTCLOUD_EXPORTER_TOKEN%"
]
}
]
}

View File

@@ -0,0 +1,72 @@
## Prometheus Nextcloud Exporter
A Prometheus exporter that collects metrics from your Nextcloud instance for monitoring and alerting.
### How to install
See the [Community Containers documentation](https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers) for instructions on how to install this in your Nextcloud All-in-One setup.
### Security & Access
**Important:** This container is configured to bind only to `127.0.0.1` (localhost) for security reasons. Prometheus exporters typically don't include authentication, so direct network exposure is not recommended.
#### Access Options
1. **With Caddy Container (Recommended)**: If you also install the [Caddy community container](https://github.com/nextcloud/all-in-one/tree/main/community-containers/caddy), it will automatically configure secure HTTPS access to your metrics with authentication at `metrics.your-domain.com`
**Getting Authentication Credentials**:
- **Username**: Always `metrics`
- **Password**: After deploying the nextcloud-exporter container, the automatically generated password will be displayed in the AIO interface. Look for it in the container section below the container name "Prometheus Nextcloud Exporter".
2. **Custom Reverse Proxy**: Set up your own reverse proxy (nginx, Apache, etc.) to provide HTTPS and authentication. See configuration guides:
- [NGINX Authentication](https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html) + [Reverse Proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/)
- [Apache Authentication](https://httpd.apache.org/docs/2.4/howto/auth.html) + [Reverse Proxy](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html)
- [Traefik BasicAuth](https://doc.traefik.io/traefik/middlewares/http/basicauth/)
- [Prometheus Security Best Practices](https://prometheus.io/docs/operating/security/)
3. **Direct Local Access**: Access metrics directly from the server at `http://127.0.0.1:9205/metrics` (no authentication)
### What it monitors
- User activity (active users hourly, daily)
- File counts and storage usage
- System health and database size
- App statistics and update availability
- Nextcloud performance metrics
### Prometheus Configuration
For **local server access** (if Prometheus runs on the same server):
```yaml
scrape_configs:
- job_name: 'nextcloud'
scrape_interval: 90s
static_configs:
- targets: ['127.0.0.1:9205']
metrics_path: /metrics
scheme: http
```
For **Caddy integration** (secure external access):
```yaml
scrape_configs:
- job_name: 'nextcloud'
scrape_interval: 90s
static_configs:
- targets: ['metrics.your-domain.com']
metrics_path: /
scheme: https
basic_auth:
username: 'metrics'
password: 'your-generated-password'
```
### Visualization
Compatible with Grafana for creating monitoring dashboards:
- Pre-built dashboard available: [Grafana Dashboard #20716](https://grafana.com/grafana/dashboards/20716-nextcloud/)
### Repository
https://github.com/xperimental/nextcloud-exporter
### Maintainer
https://github.com/grotax