[SOLVED] proxmox metric server -> Influxdb -> grafana

proxtib

Member
Dec 16, 2020
25
1
6
34
Hello,

I would like to use an influx db db as a proxmox metric server and after connecting them to Grafana.

- What is the recommended version of influxdb ? Influxdb or Influxdb2 ?
- I am not sure, with Influxdb2 only http https works ? No udp ?
- When I try to connect promox to a lxc influxdb2 with HTTPS (port 8086), I have the following issue:

500 Can't connect to LXC-IP:8086 (SSL connect attempt failed error:1408F10B:SSL routines:ssl3_get_record:wrong version number) (500)

I don't understand, is a issue with ssl version or the ssl self-signed ?
 
Hi,
What is the recommended version of influxdb ? Influxdb or Influxdb2 ?
Both work and are supported in Proxmox VE.
I am not sure, with Influxdb2 only http https works ? No udp ?
TLDR; UDP is not really ideal in influxdb (no real auth, no good way to fragementation for big data, no encryption, ...) and was depreacated. HTTP(s) works for InfluxDB 1.8+ and 2.0+

In general see: https://pve.proxmox.com//pve-docs/chapter-sysadmin.html#metric_server_influxdb
I don't understand, is a issue with ssl version or the ssl self-signed ?
Well what TLS/SSL version(s) does your influxdb, or reverse proxy server, if any, support? Normally that should only be an issue if either the influx/proxy version or the PVE version is very ancient.

And yes, by default a trusted certificate is required, so you can either:
  • use something like Let's Encrypt to get a valid one
  • add the CA of the self-signed to the PVE host's trust store
  • Set the verify-certificate to 0 - which needs to be done manually currently IIRC by editing /etc/pve/status.cfg. We should add that checkbox to the GUI though...
 
Last edited:
TLDR; UDP is not really ideal in influxdb (no real auth, no good way to fragementation for big data, no encryption, ...) and was depreacated. HTTP(s) works for InfluxDB 1.8+ and 2.0+
Ok so InfluxDB2 with https.
For information:
Code:
# cat /etc/influxdb/config.toml
bolt-path = "/var/lib/influxdb/influxd.bolt"
engine-path = "/var/lib/influxdb/engine"
tls-cert = "/etc/influxdb/mycert.crt"
tls-key = "/etc/influxdb/mykey.key"
# chmod 644 /etc/influxdb/mycert.crt
# chmod 600 /etc/influxdb/mykey.key
#
root@metriques:~# systemctl status influxdb
* influxdb.service - InfluxDB is an open-source, distributed, time series database
     Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-10-07 20:29:43 UTC; 11min ago
       Docs: https://docs.influxdata.com/influxdb/
    Process: 1545 ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh (code=exited, status=0/SUCCESS)
   Main PID: 1546 (influxd)
      Tasks: 8 (limit: 57630)
     Memory: 63.9M
        CPU: 2.478s
     CGroup: /system.slice/influxdb.service
             `-1546 /usr/bin/influxd

Oct 07 20:40:58 metriques influxd-systemd-start.sh[1546]: ts=2022-10-07T20:40:58.606627Z lvl=info msg=Unauthorized log_id=0dP24SpW000 error="authorization not found"
Oct 07 20:40:58 metriques influxd-systemd-start.sh[1546]: ts=2022-10-07T20:40:58.693942Z lvl=info msg=Unauthorized log_id=0dP24SpW000 error="authorization not found"
Oct 07 20:41:08 metriques influxd-systemd-start.sh[1546]: ts=2022-10-07T20:41:08.731298Z lvl=info msg=Unauthorized log_id=0dP24SpW000 error="authorization not found"
Oct 07 20:41:08 metriques influxd-systemd-start.sh[1546]: ts=2022-10-07T20:41:08.756470Z lvl=info msg=Unauthorized log_id=0dP24SpW000 error="authorization not found"
Oct 07 20:41:08 metriques influxd-systemd-start.sh[1546]: ts=2022-10-07T20:41:08.826643Z lvl=info msg=Unauthorized log_id=0dP24SpW000 error="authorization not found"

lvl=info msg=Unauthorized log_id=0dP24SpW000 error="authorization not found"
:oops:

On my PVE, I have
- serveur: lxc ip
- port 8086
- protocol HTTPS
- Organization proxmox
- Bucket proxmox
- Tocken <mytocken>



You meant https://<My-PVE-IP-or-FQDM>:8006/pve-docs/chapter-sysadmin.html#metric_server_influxdb , no ?
 
Last edited:
Yes, or the simplest, the "help" button, when configuring influxDB via the graphical interface. :)
Anyway, I have no data on my InfluxDB bucket. And I have the following issue when I execute "systemctl status influxdb"

metriques influxd-systemd-start.sh[133]: ts=2022-10-08T17:02:57.598649Z lvl=info msg=Unauthorized log_id=0dP2wiBW000 error="authorization not found"

Do you know where the log influxdb are located ?
I have nothing on /var/log/influxdb

-> /etc/pve/status.cfg
influxdb: lxc-metriques
port 8086
server 172.16.0.5
influxdbproto https

(pve version: 7.2-11)
 
Last edited:
Code:
apt update && apt upgrade -y && apt install gpg -y
wget -q https://repos.influxdata.com/influxdb.key
echo '23a1c8836f0afc5ed24e0486339d7cc8f6790b83886c4c96995b88a061c5bb5d influxdb.key' | sha256sum -c && cat influxdb.key | gpg --dearmor |  tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/debian stable main' |  tee /etc/apt/sources.list.d/influxdata.list
apt update && apt install influxdb2 -y
cat > /usr/local/share/ca-certificates/my-ca.crt << EOF
content-my-ca
EOF
update-ca-certificates
systemctl start influxdb
influx setup
systemctl status influxdb
systemctl stop influxdb
cat >/etc/influxdb/config.toml << EOF
bolt-path = "/var/lib/influxdb/influxd.bolt"
engine-path = "/var/lib/influxdb/engine"
tls-cert = "/etc/influxdb/influxdb.crt"
tls-key = "/etc/influxdb/influxdb.key"
host = "https://localhost:8086"
EOF
cat > /etc/influxdb/influxdb.crt << EOF
content influxdb.crt
EOF
cat > /etc/influxdb/influxdb.key << EOF
content influxdb.key
EOF
chmod 644 /etc/influxdb/metriques.lan78.charbowicz.tf.crt
chmod 600 /etc/influxdb/metriques.lan78.charbowicz.tf.key
chown -R influxdb: /etc/influxdb
systemctl enable --now influxdb
systemctl status influxdb