A Prometheus exporter for monitoring CernVM File System (CVMFS) clients. This tool collects comprehensive metrics from CVMFS repositories and exposes them in Prometheus format for monitoring and alerting.
Other exporters for CVMFS exist - this one was written to have a lightweight package without dependencies (in particular python). If you don't mind python, you could also take a look at https://github.com/guilbaults/cvmfs-exporter. Thanks to Simon Guilbaults for inspiration of this exporter, and having reserved port 9868 for CVMFS!
The prometheus-cvmfs-exporter provides detailed insights into CVMFS client performance, cache utilization, network activity, and system resource usage. It supports both standalone execution and systemd service deployment with socket activation.
- Comprehensive Metrics: Collects 20+ different CVMFS metrics per repository
- Multi-Repository Support: Automatically discovers and monitors all mounted CVMFS repositories
RPM-based systems (RHEL, CentOS, AlmaLinux, Fedora):
sudo rpm -ivh prometheus-cvmfs-exporter-1.0.0-1.el9.noarch.rpm
sudo systemctl enable --now cvmfs-client-prometheus.socket
DEB-based systems (Debian, Ubuntu):
sudo dpkg -i prometheus-cvmfs-exporter_1.0.0-1_all.deb
sudo systemctl enable --now cvmfs-client-prometheus.socket
# Install script and systemd files
make install install-systemd
# Enable and start the service
sudo systemctl daemon-reload
sudo systemctl enable --now cvmfs-client-prometheus.socket
/usr/libexec/cvmfs/cvmfs-prometheus.sh [OPTIONS]
Options:
-h, --help Show help message
--http Add HTTP protocol header to output
--non-standard-mountpoints Use cvmfs_config status instead of findmnt
for repository discovery
Direct execution (one-time metrics collection):
/usr/libexec/cvmfs/cvmfs-prometheus.sh
HTTP server mode (for web scraping):
/usr/libexec/cvmfs/cvmfs-prometheus.sh --http
Non-standard mountpoints:
/usr/libexec/cvmfs/cvmfs-prometheus.sh --non-standard-mountpoints
The exporter runs as a systemd socket-activated service:
# Check service status
sudo systemctl status cvmfs-client-prometheus.socket
# View service logs
sudo journalctl -u [email protected]
# Test metrics endpoint
curl http://localhost:9868
The exporter collects the following categories of metrics:
cvmfs_cached_bytes
- Currently cached data sizecvmfs_pinned_bytes
- Pinned cache data sizecvmfs_total_cache_size_bytes
- Configured cache limitcvmfs_physical_cache_size_bytes
- Physical cache volume sizecvmfs_physical_cache_avail_bytes
- Available cache spacecvmfs_hitrate
- Cache hit rate percentagecvmfs_ncleanup24
- Cache cleanups in last 24 hours
cvmfs_rx_total
- Total bytes downloaded since mountcvmfs_ndownload_total
- Total files downloaded since mountcvmfs_speed
- Average download speedcvmfs_proxy
- Available proxy serverscvmfs_active_proxy
- Currently active proxycvmfs_timeout
- Proxy connection timeoutcvmfs_timeout_direct
- Direct connection timeout
cvmfs_repo
- Repository version and revision informationcvmfs_uptime_seconds
- Time since repository mountcvmfs_mount_epoch_timestamp
- Repository mount timestampcvmfs_repo_expires_seconds
- Root catalog expiration time
cvmfs_cpu_user_total
- CPU time in userspacecvmfs_cpu_system_total
- CPU time in kernel spacecvmfs_maxfd
- Maximum file descriptors availablecvmfs_usedfd
- Currently used file descriptorscvmfs_ndiropen
- Number of open directoriescvmfs_pid
- CVMFS process ID
cvmfs_nioerr_total
- Total I/O errors encounteredcvmfs_timestamp_last_ioerr
- Timestamp of last I/O errorcvmfs_nclg
- Number of loaded nested catalogscvmfs_inode_max
- Highest possible inode number
By default, the exporter uses findmnt
to discover CVMFS repositories mounted under /cvmfs
. For non-standard setups, use the --non-standard-mountpoints
flag to use cvmfs_config status
instead.
The systemd service includes security hardening and resource limits:
- Runs as
cvmfs
user/group - Restricted system call access
- Memory limit: 32MB
- CPU weight: 30 (low priority)
- I/O scheduling: best-effort, priority 7
Add the following to your Prometheus configuration:
scrape_configs:
- job_name: 'cvmfs-exporter'
static_configs:
- targets: ['localhost:9868']
scrape_interval: 30s
scrape_timeout: 10s
- CVMFS: CernVM File System client installed and configured
- System Tools:
attr
,bc
,findmnt
,grep
,cut
,tr
- Permissions: Read access to CVMFS cache files and extended attributes
- Network: Port 9868 for HTTP metrics endpoint (when using systemd socket)
# Build packages
make package # Build both RPM and DEB
make rpm # Build RPM only
make deb # Build DEB only (requires Debian/Ubuntu)
# Install from source
make install install-systemd
- Permission Denied: Ensure the user has read access to CVMFS cache files
- No Metrics: Verify CVMFS repositories are mounted and accessible
- Socket Connection Failed: Check if systemd socket is active and port 9868 is available
# Test script manually
/usr/libexec/cvmfs/cvmfs-prometheus.sh --help
# Check CVMFS status
cvmfs_config status
# Verify repository mounts
findmnt -t fuse.cvmfs
# Check systemd service
systemctl status cvmfs-client-prometheus.socket
journalctl -u [email protected]
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
- CernVM-FS - The CernVM File System
- Prometheus - Monitoring and alerting toolkit