This guide uses Docker to run collectd.
For Docker installation, see Docker.
Create a directory to store your configuration and compose files.
mkdir -p /opt/collectd
cd /opt/collectd
Define a container for collectd with a backend configuration.
services:
collectd:
image: collectd/collectd:latest
hostname: "${HOSTNAME}"
volumes:
- ./collectd.conf:/collectd/etc/collectd.conf:ro
- /var/run/collectd:/var/run/collectd
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
environment:
- COLLECTD_HOSTNAME=${HOSTNAME}
cap_add:
- SYS_PTRACE
networks:
- monitoring
networks:
monitoring:
driver: bridge
Create collectd.conf with your backend settings:
LoadPlugin cpu
LoadPlugin memory
LoadPlugin network
<Plugin network>
Server "graphite" "25826"
Forward true
</Plugin>
Start the container in the background.
docker compose up -d
collectd/collectd is a community-maintained image (no official image exists)25826/udp for network plugin (default collectd protocol)SYS_PTRACE capability for some pluginsAny questions?
Feel free to contact us. Find all contact information on our contact page.