You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 days ago | |
|---|---|---|
| nextcloud_exporter | 2 days ago | |
| .env.example | 2 weeks ago | |
| .gitignore | 2 years ago | |
| .gitlab-ci.yml | 2 days ago | |
| LICENSE | 3 years ago | |
| README.md | 2 days ago | |
| pyproject.toml | 2 days ago | |
| uv.lock | 2 days ago | |
README.md
Nextcloud exporter
Installation
apt install -y python3-pip
pip install Nextcloud-exporter --extra-index-url https://git.open-dsi.fr/api/v4/projects/649/packages/pypi/simple
useradd -r nextcloud_exporter
Install a database driver with apt :
- PostgreSQL :
python3-psycopg2 - MariaDB :
python3-mysqldb - SQLite : Shipped with Python3
Create SystemD service :
/etc/systemd/system/nextcloud_exporter.service :
[Unit]
Description=Nextcloud exporter
After=syslog.target
After=network.target
Documentation=https://git.open-dsi.fr/nextcloud-extension/nextcloud_exporter
[Service]
ExecStart=/usr/bin/python3 -m nextcloud_exporter
EnvironmentFile=/etc/default/nextcloud_exporter
User=nextcloud_exporter
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nextcloud_exporter
SuccessExitStatus=143
TimeoutStopSec=120
Restart=always
[Install]
WantedBy=multi-user.target
Create configuration in /etc/default/nextcloud_exporter :
DB_URL="sqlite://"
DB_PREFIX=oc_
[...]
Apply, enable and start new service :
systemctl daemon-reload
systemctl enable --now nextcloud_exporter
Configuration
Environment variables :
| Name | Required | Default | Description |
|---|---|---|---|
DB_URL |
Yes | - | The SQLAlchemy database URL |
DB_PREFIX |
No | oc_ |
The Nextcloud Database prefix |
HTTP_PORT |
No | 8000 |
HTTP server port |
HTTP_ADDRESS |
No | 127.0.0.1 |
HTTP bind address |
METRICS_INTERVAL |
No | 5 |
Metrics collection interval in seconds |
DB_POOL_SIZE |
No | 1 |
SQLAlchemy connection pool size |
DB_POOL_RECYCLE |
No | 3600 |
Connection recycle interval (seconds) |
LOGLEVEL |
No | ERROR |
Logging level |
NEXTCLOUD_URL |
No | - | Nextcloud API base URL |
NEXTCLOUD_USERNAME |
No | - | Nextcloud API username |
NEXTCLOUD_PASSWORD |
No | - | Nextcloud API password |