Manual installation of Grafana and InfluxDB in a jail on TrueNAS CORE. This is aiming to provide a complete production ready setup.
- create a VNET jail on TrueNAS CORE
- make sure network settings are correct and the jail can connect to the Internet
- Log in to the jail as root either directly via SSH or via
iocage console <jail>
from the TrueNAS host
mkdir -p /usr/local/etc/pkg/repos
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest" }' >/usr/local/etc/pkg/repos/FreeBSD.conf
pkg upgrade -y
pkg autoremove -y
pkg install influxdb grafana
Create /usr/local/etc/influxd.conf
with this content:
[meta]
dir = "/var/db/influxdb/meta"
[data]
dir = "/var/db/influxdb/data"
wal-dir = "/var/db/influxdb/wal"
[[graphite]]
enabled = true
database = "graphite"
retention-policy = ""
bind-address = ":2003"
protocol = "tcp"
consistency-level = "one"
separator = "."
templates = [
"servers.* .hostname.resource.instance.measurement*",
]
This configures influxd with a single connector using the "Graphite plaintext protocol". TrueNAS CORE and e.g. OPNsense can readily send metrics to influxd using this protocol.
sysrc influxd_enable=YES
service influxd start
EOF