Closed roberto103 closed 4 months ago
Do you run the plugin as described in the README?
[[processors.execd]]
command = ["/path/to/geoip_binary", "--config", "/path/to/geoip_config_file"]
Yes, this is my telegraf.conf:
[global_tags]
[agent]
interval = "60s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
hostname = "telegraf"
omit_hostname = false
[[outputs.influxdb_v2]]
urls = ["http://influxdb:8086"]
token = "XXXXXXXXXXXXXX"
organization = "myorg"
bucket = "netflow"
[[inputs.netflow]]
service_address = "udp://:2055"
# read_buffer_size = ""
## Protocol version to use for decoding.
## Available options are
## "ipfix" -- IPFIX / Netflow v10 protocol (also works for Netflow v9)
## "netflow v5" -- Netflow v5 protocol
## "netflow v9" -- Netflow v9 protocol (also works for IPFIX)
## "sflow v5" -- sFlow v5 protocol
protocol = "netflow v9"
[[processors.execd]]
command = ["/etc/telegraf/telegraf.d/geoip", "--config", "/etc/telegraf/telegraf.d/geoip.conf"]
Can you try moving the config for the geoip plugin to a file which is not in the /etc/telegraf/telegraf.d
directory? I suspect telegraf itself is sourcing the files in that directory, while this file is supposed to be sourced by the plugin only.
I changed the files to /opt/telegraf
and this is the error I'm getting now
2023-11-13T20:48:05Z I! [processors.execd] Starting process: /opt/telegraf/geoip [--config /opt/telegraf/geoip.conf]
2023-11-13T20:48:06Z E! [telegraf] Error running agent: starting processor processors.execd: failed to start process [/opt/telegraf/geoip --config /opt/telegraf/geoip.conf]: error starting process: fork/exec /opt/telegraf/geoip: exec format error
Ok, so the previous issue is solved, telegraf now tries to run the plugin.
The exec format error
message means that the geoip plugin binary is not compiled for the architecture your docker image is using, e.g. you might have compiled on an x86 host for x86 architecture, but you might be running docker on ARM?
Closing due to inactivity.
I'm trying to use the Plugin in Telgraf v1.28.3 in Docker.
I built the GeoIP binary and copied it to the container's
/etc/telegraf/telegraf.d
folder, along with the geoip.conf and GeoLite2-City.mmdb files, but when I start the container it does not recognize the geoip processor.geoip.conf:
Container log:
Files in telegraf.d: