There are many options for setting up a new TSDB/Collector/Visualization stack, one of which is using existing supported Docker images.
- Select a desired host (<dockerhost>), such as any of the common Linux distributions.
- Ensure required docker components and dependencies exist
- (.deb)
sudo apt-get -y install docker-engine
- (.rpm)
sudo yum -y install docker
- Identify local persistent storage location(s)
- InfluxDB Data (<influxdir>)
- Grafana Data (<grafanadir>)
- Configuration Dir (<configdir>)
- (Optional) SNMP MIBs Dir (<mibsdir>)
- Ensure persistent storage locations exist
mkdir -p <influxdir> <grafanadir> <configdir> <mibsdir>
- If using the Telegraf SNMP plugin, obtain dependent MIB files if needed.
- Place these in <mibsdir> identified above
- Copy the
telegraf.conf
from this directory to <configdir> - Edit
telegraf.conf
and either explicitly definehostname
(do not leave empty) or changeomit_hostname
totrue
. - Append to
telegraf.conf
any additional telegraf configurations identified with the desired dashboard - Start three Docker containers:
- InfluxDB
-
docker run --name influxdb --rm -d -p 8086:8086 -v <influxdir>:/var/lib/influxdb influxdb
- Telegraf
-
docker run --name telegraf --rm -d -v <configdir>/telegraf.conf:/etc/telegraf/telegraf.conf:ro -v <mibsdir>:/root/.snmp/mibs:ro --net=container:influxdb nuntz/telegraf-snmp
- Grafana
-
docker run --name grafana --rm -d -p 3000:3000 -v <grafanadir>:/var/lib/grafana grafana/grafana
- Point a browser to the new Grafana instance at
http://<dockerhost>:3000
- Login with default user/pass of
admin/admin
- Click 'Add a Datasource'
- Use 'Telegraf' for the name
- Select 'InfluxDB' as the type
- Use 'http://<dockerhost>:8086' as the URL
- Use 'direct' for access
- Use 'telegraf' for InfluxDB Database (must match the
database
defined intelegraf.conf
) - Click 'Add'
- From the main menu, select 'Dashboards -> Import' to start importing and using dashboards.
- Official InfluxDB Docker Image: https://hub.docker.com/_/influxdb/
- Official Telegraf Docker Image: https://hub.docker.com/_/telegraf/
- Alternate Telegraf Docker Image: https://hub.docker.com/r/nuntz/telegraf-snmp/
- Official Grafana Docker Image: https://hub.docker.com/r/grafana/grafana/
- The above assumes the use of the Telegraf SNMP input plugin. The official Telegraf Docker image currently lacks the needed support for this plugin, so an alternate Docker image based on the official image is used above.
- The OS default distributions may have older versions of Docker. Often the official docker package repositories are configured and used instead of the OS-provided versions. See Install Docker Engine for detail.
- Once the stack is up and running, the database (InfluxDB) should be configured with authentication (users/passwords) and authorization (grants). A read/write user for Telegraf and a read-only user for Grafana is recommended.
- All three components support all of their standard configurations with their Docker implementations. See the References above for specific documentation.