influxdata / influxdata/influxdb
Collectd plugin not populating influx database
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Steps to reproduce:__
An Important notice is that this has worked before, but doesn't anymore after a reboot due to an update of Ubuntu 20.04. I am completely helpess on how to fix it now, since I don't even know what's wrong.
List the minimal actions needed to reproduce the behavior.
1. Install the latest collectd version from their website, as apt install collectd yields a faulty and unsupported release. I configured the python plugin, which works fine, and the network plugin as following;
```
LoadPlugin "network"
# # client setup:
#Server "ff18::efc0:4a42""25826"
SecurityLevel "None"
# Username "user"
# Password "secret"
# Interface "wlp3s0"
# ResolveInterval 14400
# TimeToLive 128
#
# # server setup:
# Listen "128.0.0.1" "25826"
#
# SecurityLevel Sign
# AuthFile "/etc/collectd/passwd"
# Interface "eth0"
#
# MaxPacketSize 1452
#
# # proxy setup (client and server as above):
# Forward true
#
# # statistics about the network plugin itself
ReportStats true
#
# # "garbage collection"
# CacheFlush 1800
```
I then installed the latest influxdb release via apt install, and configured as such:
```
[[collectd]]
enabled = true
bind-address = "127.0.0.1:25827"
database = "collectd"
retention-policy = ""
# The collectd service supports either scanning a directory for multiple types
# db files, or specifying a single db file.
typesdb = "/usr/share/collectd/types.db"
#
security-level = "none"
# auth-file = "/etc/collectd/auth_file"
# These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in.
# Flush if this many points get buffered
batch-size = 5000
# Number of batches that may be pending in memory
batch-pending = 10
# Flush at least this often even if we haven't hit buffer limit
batch-timeout = "10s"
# UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
read-buffer = 0
# Multi-value plugins can be handled two ways.
# "split" will parse and store the multi-value plugin data into separate measurements
# "join" will parse and store the multi-value plugin as a single multi-value measurement.
# "split" is the default behavior for backward compatibility with previous versions of influxdb.
parse-multivalue-plugin = "split"
```
Lastly, I restarted both services, and they both work. I can use the influx-cli, but sadly, the database "collectd" did not get populated, so I did a few things to ensure that collectd works;
```
./collectd -t
./collectd -T
```
Ensures that collectd is able to parse the config and that all the Plugins work as expected.
`tcpdump port 25827`
yields this result:
```
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp3s0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:54:48.722541 IP Centralnode.fritz.box.43459 > localhost.25827: UDP, length 1306
13:54:48.723897 IP Centralnode.fritz.box.43459 > localhost.25827: UDP, length 1319
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel
```
Thus, I believe, the network plugins works in collectd but still, the database does not get populated.
__Environment info:__
* System info: Linux 5.4.0-42-generic x86_64 (Ubuntu 20.04 on an old Thinkpad T430s)
* InfluxDB version: InfluxDB v1.8.1 (git: 1.8 af0237819ab9c5997c1c0144862dc762b9d8fc25)
* Collectd version: collectd 5.11.0, http://collectd.org
__Logs:__
Influxdb for some reason does not generate a logfile in /var/log/influxdb, thus I am unable to provide one.
Expected Behaviour:
The database gets populated.
Actual behavior:
Starting the influx-cli, and then "show stats":
```shname: collectd
tags: bind=:25827
batchesTx batchesTxFail bytesRx droppedPointsInvalid pointsParseFail pointsRx pointsTx readFail
--------- ------------- ------- -------------------- --------------- -------- -------- --------
0 0 0 0 0 0 0 0
>
```
Completely empty, and I don't know why.
Contributor guide
Research direction
Start with the collectd network configuration and the InfluxDB [[collectd]] configuration, then compare the reported tcpdump traffic with the empty influx-cli SHOW STATS output. Check the relevant service output or logging configuration to determine why received points are not being parsed or stored; done means identifying a reproducible cause and confirming that the collectd database is populated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, ubuntu
- Domain
- databases, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100