influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.67k stars 3.54k forks source link

Collectd plugin not populating influx database #19079

Open HelplessIdiot opened 4 years ago

HelplessIdiot commented 4 years ago

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"

<Plugin network>
#       # client setup:
        #Server "ff18::efc0:4a42""25826"
        <Server "127.0.0.1" "25827">
                SecurityLevel "None"
#               Username "user"
#               Password "secret"
#               Interface "wlp3s0"
#               ResolveInterval 14400
        </Server>
#       TimeToLive 128
#
#       # server setup:
#       Listen "128.0.0.1" "25826"
#       <Listen "239.192.74.66" "25826">
#               SecurityLevel Sign
#               AuthFile "/etc/collectd/passwd"
#               Interface "eth0"
#       </Listen>
#       MaxPacketSize 1452
#
#       # proxy setup (client and server as above):
#       Forward true
#
#       # statistics about the network plugin itself
        ReportStats true
#
#       # "garbage collection"
#       CacheFlush 1800
</Plugin>

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:

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":

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.

HelplessIdiot commented 4 years ago

So yeah I kind of fixed it by just reinstalling influxdb. I have used the exact same configs, thus I can't really explain what I did different.